diff --git a/src/config.rs b/src/config.rs index 6edbd8f..5d9a3bf 100644 --- a/src/config.rs +++ b/src/config.rs @@ -56,6 +56,12 @@ pub struct BusConfig { #[query(".pidfile")] pub pidfile: Option, + /// Adds a directory to search for .service files, + /// which tell the dbus-daemon how to start a program to provide a particular well-known bus name. + #[query(".servicedir")] + #[serde(default)] + pub servicedir: Vec, + /// If `Some`, the bus daemon will log to syslog. #[query(".syslog")] // TODO: consider finding a way to make this `bool` instead of `Option<()>` @@ -270,6 +276,27 @@ mod tests { ); } + #[test] + fn bus_config_parse_with_servicedir_ok() { + let input = r#" + + /example + /anotherexample + + "#; + + let busconfig = BusConfig::parse(input).expect("should parse XML input"); + + assert_eq!( + busconfig, + BusConfig { + servicedir: vec![PathBuf::from("/example"), PathBuf::from("/anotherexample"),], + ..Default::default() + } + ); + } + #[test] fn bus_config_parse_with_type_ok() { let input = r#"