diff options
| author | Hermes Agent <hermes@localhost> | 2026-08-12 02:33:28 +0000 |
|---|---|---|
| committer | Hermes Agent <hermes@localhost> | 2026-08-12 02:33:28 +0000 |
| commit | cad87b77c0003c851abb6264d3e373e9516edaae (patch) | |
| tree | 4dc529f514a1625fa6180fc91cf482e93419a205 /tests/compare.rs | |
| parent | dee25c497c017c2b88d618ec1ce034f86af5c452 (diff) | |
Compile typed package requests from build plans
Diffstat (limited to 'tests/compare.rs')
| -rw-r--r-- | tests/compare.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/compare.rs b/tests/compare.rs index 6dd7317..eb6d388 100644 --- a/tests/compare.rs +++ b/tests/compare.rs @@ -217,6 +217,26 @@ fn normalizes_legacy_dot_prefixed_archive_paths_before_comparison() { } #[test] +fn normalizes_dot_prefixed_paths_from_a_legacy_tree_archive() { + let fixture = tempdir().expect("temporary directory"); + let rootfs = fixture.path().join("rootfs"); + fs::create_dir_all(rootfs.join("etc")).expect("create rootfs directory"); + fs::write(rootfs.join("etc/controller.conf"), "controller\n").expect("write rootfs file"); + let artifact = fixture.path().join("legacy.tar"); + let mut archive = tar::Builder::new(fs::File::create(&artifact).expect("create legacy archive")); + archive.append_dir_all(".", &rootfs).expect("write legacy tree archive"); + archive.finish().expect("finish legacy archive"); + + let manifest = ArtifactManifest::collect_archive(&artifact).expect("collect legacy archive facts"); + + assert!(manifest.files.iter().all(|record| !record.path.starts_with("./"))); + assert!(manifest + .archive_members + .iter() + .all(|record| !record.path.starts_with("./"))); +} + +#[test] fn excludes_legacy_internal_host_and_fakedata_archive_members() { let fixture = tempdir().expect("temporary directory"); let rootfs = fixture.path().join("rootfs"); |