holger-recipe/tests/fetch_worker_media.rs
//! **Only the fetching medium ships the fetch worker** (lane cds4, plan row HOL-CDS-4;
//! rickard-e6 2026-11-01): the fetch job's code lives only in `holger-fetch-worker`, its own
//! worker build, laid as `sandbox/holger-fetch-worker.rootfs.tar` by the fetching downstream's
//! medium (`holger-downstream-installer`) alone. The one-way appliance, the estate's main, twin,
//! keep and front media never carry it, and the scan sandbox every box medium shares does not
//! name it. (Its tree guard: `server/cli/tests/one_way_ships_no_client.rs`.)
use holger_recipe::packaging::{
downstream_installer, downstream_oneway_installer, front_installer_metered,
front_keep_installer, installer, keep_installer, metered_installer, sandbox_payload_entries,
FETCH_WORKER_ROOTFS, SANDBOX_STAGE_DIR,
};
#[test]
fn only_the_fetching_medium_ships_the_fetch_worker() {
let entry = format!("sandbox/{FETCH_WORKER_ROOTFS}");
assert_eq!(FETCH_WORKER_ROOTFS, "holger-fetch-worker.rootfs.tar");
let fetching = downstream_installer();
assert_eq!(
fetching.payload_entries.get(&entry),
Some(&format!("{SANDBOX_STAGE_DIR}/{FETCH_WORKER_ROOTFS}")),
"{}",
fetching.name
);
fetching.check_payload_entries().unwrap();
for row in [
downstream_oneway_installer(),
installer(),
metered_installer(),
keep_installer(),
front_installer_metered(),
front_keep_installer(),
] {
assert!(
!row.payload_entries.contains_key(&entry),
"{} ships the fetch worker",
row.name
);
}
assert!(!sandbox_payload_entries().contains_key(&entry));
}