Skip to content

Commit 242b756

Browse files
Johan-Liebert1cgwalters
authored andcommitted
tests: Fix container tests, update CI matrix
Remove "composefs-sealeduki-sdboot" variant Only exclude ext4-unsealed-uki as we still want to run tests on unsealed bls ext4 systems Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent 12bf7dc commit 242b756

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ jobs:
180180
filesystem: xfs
181181
- seal_state: "unsealed"
182182
filesystem: ext4
183+
boot_type: uki # we still want to test ext4 unsealed bls
183184
- bootloader: grub
184185
boot_type: "uki"
185186

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ test-tmt *ARGS: build
114114
[group('core')]
115115
test-container: build build-units
116116
podman run --rm --read-only localhost/bootc-units /usr/bin/bootc-units
117-
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} {{base_img}} bootc-integration-tests container
117+
podman run --rm --env=BOOTC_variant={{variant}} --env=BOOTC_base={{base}} --env=BOOTC_boot_type={{boot_type}} {{base_img}} bootc-integration-tests container
118118

119119
[group('core')]
120120
test-composefs bootloader filesystem boot_type seal_state:
@@ -133,7 +133,7 @@ test-composefs bootloader filesystem boot_type seal_state:
133133
filesystem={{filesystem}} \
134134
boot_type={{boot_type}} \
135135
seal_state={{seal_state}} \
136-
test-tmt-nobuild --composefs-backend \
136+
test-tmt --composefs-backend \
137137
--bootloader={{bootloader}} \
138138
--filesystem={{filesystem}} \
139139
--seal-state={{seal_state}} \

crates/tests-integration/src/container.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,20 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
5050
.expect("kernel.unified should be present")
5151
.as_bool()
5252
.expect("kernel.unified should be a boolean");
53+
54+
let is_uki = std::env::var("BOOTC_boot_type").is_ok_and(|var| var == "uki");
55+
5356
if let Some(variant) = std::env::var("BOOTC_variant").ok() {
54-
match variant.as_str() {
55-
v @ "ostree" | v @ "composefs" => {
57+
match (variant.as_str(), is_uki) {
58+
(v @ "ostree", _) | (v @ "composefs", false) => {
5659
assert!(!unified, "Expected unified=false for variant {v}");
5760
// For traditional kernels, version should look like a uname (contains digits)
5861
assert!(
5962
version.chars().any(|c| c.is_ascii_digit()),
6063
"version should contain version numbers for traditional kernel: {version}"
6164
);
6265
}
63-
"composefs-sealeduki-sdboot" => {
66+
("composefs", true) => {
6467
assert!(unified, "Expected unified=true for UKI variant");
6568
// For UKI, version is the filename without .efi extension (should not end with .efi)
6669
assert!(
@@ -70,7 +73,7 @@ pub(crate) fn test_bootc_container_inspect() -> Result<()> {
7073
// Version should be non-empty after stripping extension
7174
assert!(!version.is_empty(), "version should not be empty for UKI");
7275
}
73-
o => eprintln!("notice: Unhandled variant for kernel check: {o}"),
76+
o => eprintln!("notice: Unhandled variant for kernel check: {o:?}"),
7477
}
7578
}
7679

@@ -155,17 +158,19 @@ fn test_system_reinstall_help() -> Result<()> {
155158
/// Verify that the values of `variant` and `base` from Justfile actually applied
156159
/// to this container image.
157160
fn test_variant_base_crosscheck() -> Result<()> {
161+
let is_uki = std::env::var("BOOTC_boot_type").is_ok_and(|var| var == "uki");
162+
158163
if let Some(variant) = std::env::var("BOOTC_variant").ok() {
159164
// TODO add this to `bootc status` or so?
160165
let boot_efi = Utf8Path::new("/boot/EFI");
161-
match variant.as_str() {
162-
"composefs" | "ostree" => {
166+
match (variant.as_str(), is_uki) {
167+
("composefs", false) | ("ostree", _) => {
163168
assert!(!boot_efi.try_exists()?);
164169
}
165-
"composefs-sealeduki-sdboot" => {
170+
("composefs", true) => {
166171
assert!(boot_efi.try_exists()?);
167172
}
168-
o => panic!("Unhandled variant: {o}"),
173+
o => panic!("Unhandled variant: {o:?}"),
169174
}
170175
}
171176
if let Some(base) = std::env::var("BOOTC_base").ok() {

0 commit comments

Comments
 (0)