pub const INIT_IMAGE: &str = concat!(
"ghcr.io/apple/containerization/vminit:",
env!("CFW_CONTAINERIZATION_VERSION")
);
pub const KERNEL_ARCHIVE_URL: &str =
"https://github.com/kata-containers/kata-containers/releases/download/3.17.0/kata-static-3.17.0-arm64.tar.xz";
pub const KERNEL_IN_ARCHIVE: &str = "opt/kata/share/kata-containers/vmlinux.container";
#[cfg(test)]
mod tests {
#[test]
fn names_the_init_image_for_the_pinned_release() {
assert_eq!(super::INIT_IMAGE, "ghcr.io/apple/containerization/vminit:0.51.0");
}
#[cfg(target_os = "macos")]
#[test]
fn downloads_the_kernel_containerizations_makefile_pins() {
let makefile = std::path::Path::new(env!("CFW_CONTAINERIZATION_CHECKOUT")).join("Makefile");
let makefile = std::fs::read_to_string(&makefile)
.unwrap_or_else(|error| panic!("{} should be readable: {error}", makefile.display()));
let pinned = makefile
.lines()
.find_map(|line| line.strip_prefix("KATA_BINARY_PACKAGE := "))
.expect("Containerization's Makefile should pin KATA_BINARY_PACKAGE");
assert_eq!(pinned.trim(), super::KERNEL_ARCHIVE_URL);
}
}