diff options
Diffstat (limited to 'tests')
| -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 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"); |