Skip to content

Commit 7c014c4

Browse files
test/integration: Test vmlinuz non-existence with UKI
vmlinuz and intrd should not be present in UKI images; add test for the same Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent f88110b commit 7c014c4

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

crates/tests-integration/src/container.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use indoc::indoc;
22
use scopeguard::defer;
33
use serde::Deserialize;
4-
use std::fs;
54
use std::process::Command;
5+
use std::{fs, path::Path};
66

77
use anyhow::{Context, Result};
88
use camino::Utf8Path;
@@ -51,8 +51,6 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
5151
.as_bool()
5252
.expect("kernel.unified should be a boolean");
5353

54-
println!("kernel: {kernel:#?}");
55-
5654
let is_uki = std::env::var("BOOTC_boot_type").is_ok_and(|var| var == "uki");
5755

5856
if let Some(variant) = std::env::var("BOOTC_variant").ok() {
@@ -74,6 +72,18 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
7472
);
7573
// Version should be non-empty after stripping extension
7674
assert!(!version.is_empty(), "version should not be empty for UKI");
75+
76+
// For UKI make sure vmlinuz + initrd don't exist
77+
let usr_lib_mod = Path::new("/usr/lib/modules").join(version);
78+
assert!(usr_lib_mod.exists(), "'{usr_lib_mod:?}' does not exist");
79+
assert!(
80+
!usr_lib_mod.join("vmlinuz").exists(),
81+
"vmlinuz should not exist for UKI"
82+
);
83+
assert!(
84+
!usr_lib_mod.join("initramfs.img").exists(),
85+
"initramfs should not exist for UKI"
86+
);
7787
}
7888
o => eprintln!("notice: Unhandled variant for kernel check: {o:?}"),
7989
}

0 commit comments

Comments
 (0)