Skip to content

Commit 0f0442d

Browse files
committed
wip tests
1 parent 6e0a9d0 commit 0f0442d

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

tmt/plans/integration.fmf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,17 @@ execute:
8585
- when: running_env == packit
8686
enabled: false
8787
because: tmt-reboot does not work with systemd reboot in testing farm environment
88+
89+
/test-28-install-unified-flag:
90+
summary: Verify install help exposes experimental unified storage flag
91+
discover:
92+
how: fmf
93+
test:
94+
- /tmt/tests/test-28-install-unified-flag
95+
96+
/test-29-switch-to-unified:
97+
summary: Onboard to unified storage and verify subsequent operations use it
98+
discover:
99+
how: fmf
100+
test:
101+
- /tmt/tests/test-29-switch-to-unified
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use tap.nu
2+
3+
def main [] {
4+
tap begin "install help shows experimental unified flag"
5+
let help = (bootc install --help)
6+
# Grep-like check in nushell
7+
let has = ($help | lines | any { |l| $l | str contains "--experimental-unified-storage" })
8+
if (not $has) {
9+
error make { msg: "missing --experimental-unified-storage in help" }
10+
}
11+
tap ok
12+
}
13+
14+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use std assert
2+
use tap.nu
3+
4+
# Multi-boot test: boot 0 onboards to unified storage; boot 1 verifies we use containers-storage
5+
6+
def main [] {
7+
match $env.TMT_REBOOT_COUNT? {
8+
null | "0" => first_boot,
9+
"1" => second_boot,
10+
$o => { error make { msg: $"Invalid TMT_REBOOT_COUNT ($o)" } },
11+
}
12+
}
13+
14+
def first_boot [] {
15+
tap begin "onboard to unified storage"
16+
# Sanity: booted status
17+
let st = (bootc status --json | from json)
18+
# Run the onboarding command
19+
bootc image set-unified
20+
# Verify bootc-owned store is usable
21+
podman --storage-opt=additionalimagestore=/usr/lib/bootc/storage images
22+
# Stage a no-op upgrade to exercise the unified path; tolerate no-update
23+
bootc upgrade || true
24+
tmt-reboot
25+
}
26+
27+
def second_boot [] {
28+
tap begin "verify unified usage after onboarding"
29+
let st = (bootc status --json | from json)
30+
let booted = $st.status.booted.image
31+
# After onboarding, future pulls may use containers-storage; assert transport is either registry or containers-storage
32+
assert ($booted.transport in [registry containers-storage])
33+
tap ok
34+
}
35+
36+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
summary: Verify install help exposes experimental unified storage flag
2+
test: nu booted/test-install-unified-flag.nu
3+
duration: 5m
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
summary: Onboard to unified storage and verify subsequent operations use it
2+
test: nu booted/test-switch-to-unified.nu
3+
duration: 30m

0 commit comments

Comments
 (0)