summaryrefslogtreecommitdiff
path: root/tests/compare.rs
diff options
context:
space:
mode:
authorHermes Agent <hermes@localhost>2026-08-12 02:51:50 +0000
committerHermes Agent <hermes@localhost>2026-08-12 02:51:50 +0000
commit5384232eec4dff669cd2bb68ee93c34b6b63c78c (patch)
treede303d2741202c98ebc4b11af09ba1aab690eb6d /tests/compare.rs
parent450a5b27e101e7b40cd2d035056c4141e9477f6a (diff)
Collect services from all systemd targets
Diffstat (limited to 'tests/compare.rs')
-rw-r--r--tests/compare.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/compare.rs b/tests/compare.rs
index fded37f..37135a7 100644
--- a/tests/compare.rs
+++ b/tests/compare.rs
@@ -291,6 +291,28 @@ fn native_manifest_collection_excludes_internal_members_from_its_archive_facts()
}
#[test]
+fn rootfs_collection_recognizes_services_enabled_by_non_default_targets() {
+ let fixture = tempdir().expect("temporary directory");
+ let rootfs = fixture.path().join("rootfs");
+ let wants = rootfs.join("etc/systemd/system/graphical.target.wants");
+ fs::create_dir_all(&wants).expect("create service state directory");
+ symlink(
+ "/usr/lib/systemd/system/controller.service",
+ wants.join("controller.service"),
+ )
+ .expect("enable service");
+ let artifact = fixture.path().join("controller.tar");
+ NativeTarWriter::new()
+ .write(&rootfs, &artifact)
+ .expect("write native archive");
+
+ let manifest = ArtifactManifest::collect(&rootfs, vec![], None, &artifact)
+ .expect("collect native filesystem and archive facts");
+
+ assert_eq!(manifest.services, vec![ServiceRecord::new("controller.service", true)]);
+}
+
+#[test]
fn archive_collection_coalesces_a_service_enabled_by_multiple_targets() {
let fixture = tempdir().expect("temporary directory");
let rootfs = fixture.path().join("rootfs");