Skip to content

Commit cdae3da

Browse files
tests: Fix container tests
Remove "composefs-sealeduki-sdboot" variant Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent a860208 commit cdae3da

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ jobs:
178178
bootloader: grub
179179
- seal_state: "sealed"
180180
filesystem: xfs
181+
- seal_state: "unsealed"
182+
filesystem: ext4
181183
- bootloader: grub
182184
boot_type: "uki"
183185

@@ -249,7 +251,14 @@ jobs:
249251
if: always()
250252
uses: actions/upload-artifact@v6
251253
with:
252-
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ matrix.variant }}-${{ matrix.boot_type }}-${{ matrix.filesystem }}-${{ matrix.seal_state }}-${{ env.ARCH }}
254+
name: "tmt-log-PR-${{ github.event.number }}-\
255+
${{ matrix.test_os }}-\
256+
${{ matrix.variant }}-\
257+
${{ matrix.bootloader }}-\
258+
${{ matrix.boot_type }}-\
259+
${{ matrix.filesystem }}-\
260+
${{ matrix.seal_state }}-\
261+
${{ env.ARCH }}"
253262
path: /var/tmp/tmt
254263

255264
# Test bootc install on Fedora CoreOS (separate job to avoid disk space issues

Justfile

Lines changed: 1 addition & 1 deletion
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:

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)