diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 03:44:16 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 03:44:16 +0000 |
| commit | 0fad03030080f99d7d1e0a360146f66245165eae (patch) | |
| tree | 6546c9e3f1a98a90e2492de9c998cbef59336972 /tests/compare.rs | |
| parent | 754972b95ba2fabc082aed387c246e632a8d7434 (diff) | |
Validate direct rootfs service facts
Diffstat (limited to 'tests/compare.rs')
| -rw-r--r-- | tests/compare.rs | 22 |
1 files changed, 22 insertions, 0 deletions
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()); +} |