Skip to content

Commit 8402cfd

Browse files
Johan-Liebert1cgwalters
authored andcommitted
tests: Add fixme_skip_if_composefs extra field
Instead of `works_for_composefs` field, we use this new one. The plan is to keep removing these one by one and increasing the test coverage Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent fccc244 commit 8402cfd

19 files changed

+41
-34
lines changed

crates/xtask/src/tmt.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const FIELD_TRY_BIND_STORAGE: &str = "try_bind_storage";
2222
const FIELD_SUMMARY: &str = "summary";
2323
const FIELD_ADJUST: &str = "adjust";
2424

25-
const FIELD_WORKS_FOR_COMPOSEFS: &str = "works_for_composefs";
25+
const FIELD_FIXME_SKIP_IF_COMPOSEFS: &str = "fixme_skip_if_composefs";
2626

2727
// bcvk options
2828
const BCVK_OPT_BIND_STORAGE_RO: &str = "--bind-storage-ro";
@@ -252,7 +252,7 @@ fn verify_ssh_connectivity(sh: &Shell, port: u16, key_path: &Utf8Path) -> Result
252252
#[derive(Debug)]
253253
struct PlanMetadata {
254254
try_bind_storage: bool,
255-
works_for_composefs: bool,
255+
skip_if_composefs: bool,
256256
}
257257

258258
/// Parse integration.fmf to extract extra-try_bind_storage for all plans
@@ -293,21 +293,21 @@ fn parse_plan_metadata(
293293
.and_modify(|m| m.try_bind_storage = b)
294294
.or_insert(PlanMetadata {
295295
try_bind_storage: b,
296-
works_for_composefs: false,
296+
skip_if_composefs: false,
297297
});
298298
}
299299
}
300300

301301
if let Some(works_for_composefs) = plan_data.get(&serde_yaml::Value::String(format!(
302302
"extra-{}",
303-
FIELD_WORKS_FOR_COMPOSEFS
303+
FIELD_FIXME_SKIP_IF_COMPOSEFS
304304
))) {
305305
if let Some(b) = works_for_composefs.as_bool() {
306306
plan_metadata
307307
.entry(plan_name.to_string())
308-
.and_modify(|m| m.works_for_composefs = b)
308+
.and_modify(|m| m.skip_if_composefs = b)
309309
.or_insert(PlanMetadata {
310-
works_for_composefs: b,
310+
skip_if_composefs: b,
311311
try_bind_storage: false,
312312
});
313313
}
@@ -401,10 +401,10 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> {
401401

402402
if args.composefs_backend {
403403
plans.retain(|plan| {
404-
plan_metadata
404+
!plan_metadata
405405
.iter()
406406
.find(|(key, _)| plan.ends_with(key.as_str()))
407-
.map(|(_, v)| v.works_for_composefs)
407+
.map(|(_, v)| v.skip_if_composefs)
408408
.unwrap_or(false)
409409
});
410410
}
@@ -1005,7 +1005,7 @@ pub(crate) fn update_integration() -> Result<()> {
10051005
.as_mapping()
10061006
.and_then(|m| {
10071007
m.get(&serde_yaml::Value::String(
1008-
FIELD_WORKS_FOR_COMPOSEFS.to_string(),
1008+
FIELD_FIXME_SKIP_IF_COMPOSEFS.to_string(),
10091009
))
10101010
})
10111011
.and_then(|v| v.as_bool())
@@ -1137,7 +1137,7 @@ pub(crate) fn update_integration() -> Result<()> {
11371137

11381138
if test.works_for_composefs {
11391139
plan_value.insert(
1140-
serde_yaml::Value::String(format!("extra-{}", FIELD_WORKS_FOR_COMPOSEFS)),
1140+
serde_yaml::Value::String(format!("extra-{}", FIELD_FIXME_SKIP_IF_COMPOSEFS)),
11411141
serde_yaml::Value::Bool(true),
11421142
);
11431143
}

tmt/plans/integration.fmf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,45 +49,43 @@ execute:
4949
test:
5050
- /tmt/tests/tests/test-01-readonly
5151
extra-try_bind_storage: true
52-
extra-works_for_composefs: true
5352

5453
/plan-20-image-pushpull-upgrade:
5554
summary: Execute local upgrade tests
5655
discover:
5756
how: fmf
5857
test:
5958
- /tmt/tests/tests/test-20-image-pushpull-upgrade
60-
extra-works_for_composefs: true
6159

6260
/plan-21-logically-bound-switch:
6361
summary: Execute logically bound images tests for switching images
6462
discover:
6563
how: fmf
6664
test:
6765
- /tmt/tests/tests/test-21-logically-bound-switch
66+
extra-fixme_skip_if_composefs: true
6867

6968
/plan-22-logically-bound-install:
7069
summary: Execute logically bound images tests for installing image
7170
discover:
7271
how: fmf
7372
test:
7473
- /tmt/tests/tests/test-22-logically-bound-install
74+
extra-fixme_skip_if_composefs: true
7575

7676
/plan-23-install-outside-container:
7777
summary: Execute tests for installing outside of a container
7878
discover:
7979
how: fmf
8080
test:
8181
- /tmt/tests/tests/test-23-install-outside-container
82-
extra-works_for_composefs: true
8382

8483
/plan-23-usroverlay:
8584
summary: Execute tests for bootc usrover
8685
discover:
8786
how: fmf
8887
test:
8988
- /tmt/tests/tests/test-23-usroverlay
90-
extra-works_for_composefs: true
9189

9290
/plan-24-image-upgrade-reboot:
9391
summary: Execute local upgrade tests
@@ -96,23 +94,20 @@ execute:
9694
test:
9795
- /tmt/tests/tests/test-24-image-upgrade-reboot
9896
extra-try_bind_storage: true
99-
extra-works_for_composefs: true
10097

10198
/plan-25-soft-reboot:
10299
summary: Execute soft reboot test
103100
discover:
104101
how: fmf
105102
test:
106103
- /tmt/tests/tests/test-25-soft-reboot
107-
extra-works_for_composefs: true
108104

109105
/plan-26-download-only-upgrade:
110106
summary: Execute download-only upgrade tests
111107
discover:
112108
how: fmf
113109
test:
114110
- /tmt/tests/tests/test-26-download-only-upgrade
115-
extra-works_for_composefs: true
116111

117112
/plan-27-custom-selinux-policy:
118113
summary: Execute custom selinux policy test
@@ -124,13 +119,15 @@ execute:
124119
- when: running_env != image_mode
125120
enabled: false
126121
because: these tests require features only available in image mode
122+
extra-fixme_skip_if_composefs: true
127123

128124
/plan-28-factory-reset:
129125
summary: Execute factory reset tests
130126
discover:
131127
how: fmf
132128
test:
133129
- /tmt/tests/tests/test-28-factory-reset
130+
extra-fixme_skip_if_composefs: true
134131

135132
/plan-29-soft-reboot-selinux-policy:
136133
summary: Test soft reboot with SELinux policy changes
@@ -145,35 +142,38 @@ execute:
145142
how: fmf
146143
test:
147144
- /tmt/tests/tests/test-30-install-unified-flag
145+
extra-fixme_skip_if_composefs: true
148146

149147
/plan-31-switch-mutate-in-place:
150148
summary: switch --mutate-in-place
151149
discover:
152150
how: fmf
153151
test:
154152
- /tmt/tests/tests/test-31-switch-mutate-in-place
153+
extra-fixme_skip_if_composefs: true
155154

156155
/plan-31-switch-to-unified:
157156
summary: Onboard to unified storage, build derived image, and switch to it
158157
discover:
159158
how: fmf
160159
test:
161160
- /tmt/tests/tests/test-31-switch-to-unified
161+
extra-fixme_skip_if_composefs: true
162162

163163
/plan-32-install-to-filesystem-var-mount:
164164
summary: Test bootc install to-filesystem with separate /var mount
165165
discover:
166166
how: fmf
167167
test:
168168
- /tmt/tests/tests/test-32-install-to-filesystem-var-mount
169-
extra-works_for_composefs: true
170169

171170
/plan-33-bib-build:
172171
summary: Test building a qcow2 disk image with bootc-image-builder
173172
discover:
174173
how: fmf
175174
test:
176175
- /tmt/tests/tests/test-33-bib-build
176+
extra-fixme_skip_if_composefs: true
177177

178178
/plan-34-user-agent:
179179
summary: Verify bootc sends correct User-Agent header to registries

tmt/tests/booted/test-01-readonly.nu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# number: 1
22
# extra:
33
# try_bind_storage: true
4-
# works_for_composefs: true
54
# tmt:
65
# summary: Execute booted readonly/nondestructive tests
76
# duration: 30m

tmt/tests/booted/test-bib-build.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# duration: 45m
55
# require:
66
# - qemu-img
7+
# extra:
8+
# fixme_skip_if_composefs: true
79
#
810
# This test validates that bootc-image-builder (bib) can successfully
911
# create disk images from the current booted image. This is a critical

tmt/tests/booted/test-custom-selinux-policy.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# - when: running_env != image_mode
77
# enabled: false
88
# because: these tests require features only available in image mode
9+
# extra:
10+
# fixme_skip_if_composefs: true
911
#
1012
# Verify that correct labels are applied after a deployment
1113
use std assert

tmt/tests/booted/test-download-only-upgrade.nu

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# tmt:
33
# summary: Execute download-only upgrade tests
44
# duration: 40m
5-
# extra:
6-
# works_for_composefs: true
75
#
86
# This test does:
97
# bootc image copy-to-storage

tmt/tests/booted/test-factory-reset.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# tmt:
33
# summary: Execute factory reset tests
44
# duration: 30m
5+
# extra:
6+
# fixme_skip_if_composefs: true
57
#
68
use std assert
79
use tap.nu

tmt/tests/booted/test-image-pushpull-upgrade.nu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# tmt:
33
# summary: Execute local upgrade tests
44
# duration: 30m
5-
# extra:
6-
# works_for_composefs: true
75
#
86
# This test does:
97
# bootc image copy-to-storage
@@ -75,6 +73,8 @@ RUN echo test content > /usr/share/blah.txt
7573
# nushell doesn't do fd passing right now either, so run via bash
7674
bash -c $"bootc switch --progress-fd 3 --transport containers-storage localhost/bootc-derived 3>($progress_fifo)"
7775

76+
# Composefs installation right now do not share progress
77+
# See https://github.com/containers/composefs-rs/issues/140
7878
if not $is_composefs {
7979
# Now, let's do some checking of the progress json
8080
let progress = open --raw $progress_json | from json -o

tmt/tests/booted/test-image-upgrade-reboot.nu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# number: 24
22
# extra:
33
# try_bind_storage: true
4-
# works_for_composefs: true
54
# tmt:
65
# summary: Execute local upgrade tests
76
# duration: 30m

tmt/tests/booted/test-install-outside-container.nu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# tmt:
33
# summary: Execute tests for installing outside of a container
44
# duration: 30m
5-
# extra:
6-
# works_for_composefs: true
75
#
86
use std assert
97
use tap.nu
@@ -31,12 +29,14 @@ umount /var/mnt
3129
# And using systemd-run here breaks our install_t so we disable SELinux enforcement
3230
setenforce 0
3331

32+
let base_args = $"bootc install to-disk --disable-selinux --via-loopback --source-imgref ($target_image)"
33+
3434
let install_cmd = if (tap is_composefs) {
3535
let st = bootc status --json | from json
3636
let bootloader = ($st.status.booted.composefs.bootloader | str downcase)
37-
$"bootc install to-disk --disable-selinux --via-loopback --composefs-backend --bootloader=($bootloader) --filesystem ext4 --source-imgref ($target_image) ./disk.img"
37+
$"($base_args) --composefs-backend --bootloader=($bootloader) --filesystem ext4 ./disk.img"
3838
} else {
39-
$"bootc install to-disk --disable-selinux --via-loopback --filesystem xfs --source-imgref ($target_image) ./disk.img"
39+
$"($base_args) --filesystem xfs ./disk.img"
4040
}
4141

4242
systemd-run -p MountFlags=slave -qdPG -- /bin/sh -c $"

0 commit comments

Comments
 (0)