message: config/fragment: add basic TOML test
diff: use serde::Deserialize;
  /// Top-level configuration stanza.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct ConfigFragment {
  /// Cincinnati client configuration.
  pub(crate) cincinnati: Option<CincinnatiFragment>,
  @@ -13,7 +13,7 @@ pub(crate) struct ConfigFragment {
  pub(crate) updates: Option<UpdateFragment>,
  }
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct IdentityFragment {
  /// Update group for this agent (default: 'default')
  pub(crate) group: Option<String>,
  @@ -24,14 +24,14 @@ pub(crate) struct IdentityFragment {
  }
  /// Config fragment for Cincinnati client.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct CincinnatiFragment {
  /// Base URL to upstream cincinnati server.
  pub(crate) base_url: Option<String>,
  }
  /// Config fragment for update logic.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct UpdateFragment {
  /// Update strategy (default: immediate)
  pub(crate) strategy: Option<String>,
  @@ -44,7 +44,7 @@ pub(crate) struct UpdateFragment {
  }
  /// Config fragment for `immediate` update strategy.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct UpImmediateFragment {
  /// Whether to check for and fetch updates.
  pub(crate) fetch_updates: Option<String>,
  @@ -53,14 +53,49 @@ pub(crate) struct UpImmediateFragment {
  }
  /// Config fragment for `remote_http` update strategy.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct UpHttpFragment {
  /// Base URL for the remote semaphore manager.
  pub(crate) base_url: Option<String>,
  }
  /// Config fragment for `periodic` update strategy.
  -#[derive(Debug, Deserialize)]
  +#[derive(Debug, Deserialize, PartialEq, Eq)]
  pub(crate) struct UpPeriodicFragment {
  // TODO(lucab): define entries.
  }
  +
  +#[cfg(test)]
  +mod tests {
  + use super::*;
  + use std::io::Read;
  +
  + #[test]
  + fn basic_dist_config_sample() {
  + let fp = std::fs::File::open("dist/examples/00-config-sample.toml").unwrap();
  + let mut bufrd = std::io::BufReader::new(fp);
  + let mut content = vec![];
  + bufrd.read_to_end(&mut content).unwrap();
  + let cfg: ConfigFragment = toml::from_slice(&content).unwrap();
  +
  + let expected = ConfigFragment {
  + cincinnati: None,
  + identity: Some(IdentityFragment {
  + group: Some("workers".to_string()),
  + node_uuid: None,
  + throttle_permille: None,
  + }),
  + updates: Some(UpdateFragment {
  + strategy: Some("immediate".to_string()),
  + immediate: Some(UpImmediateFragment {
  + fetch_updates: Some("true".to_string()),
  + finalize_updates: Some("true".to_string()),
  + }),
  + periodic: None,
  + remote_http: None,
  + }),
  + };
  +
  + assert_eq!(cfg, expected);
  + }
  +}
  