From 0fad03030080f99d7d1e0a360146f66245165eae Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Wed, 12 Aug 2026 03:44:16 +0000 Subject: Validate direct rootfs service facts --- tests/compare.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/compare.rs b/tests/compare.rs index a175195..8bc1a07 100644 --- a/tests/compare.rs +++ b/tests/compare.rs @@ -446,3 +446,25 @@ fn archive_collection_only_treats_direct_target_wants_symlinks_as_enabled_servic assert!(manifest.services.is_empty()); } + +#[test] +fn rootfs_collection_only_treats_direct_target_wants_symlinks_as_enabled_services() { + let fixture = tempdir().expect("temporary directory"); + let rootfs = fixture.path().join("rootfs"); + let nested_wants = rootfs.join("etc/systemd/system/multi-user.target.wants/nested"); + fs::create_dir_all(&nested_wants).expect("create nested service state directory"); + symlink( + "/usr/lib/systemd/system/controller.service", + nested_wants.join("controller.service"), + ) + .expect("create nested service symlink"); + 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!(manifest.services.is_empty()); +} -- cgit v1.2.3