Skip to content

Commit 0983286

Browse files
committed
DNM: still fighting tmt-reboot...
1 parent 7814631 commit 0983286

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

tmt/tests/booted/test-soft-reboot.nu

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ if not $soft_reboot_capable {
1111
# This code runs on *each* boot.
1212
# Here we just capture information.
1313
bootc status
14-
let st = bootc status --json | from json
15-
let booted = $st.status.booted.image
1614

1715
# Run on the first boot
1816
def initial_build [] {
@@ -34,25 +32,16 @@ RUN echo test content > /usr/share/testfile-for-soft-reboot.txt
3432
let st = bootc status --json | from json
3533
assert $st.status.staged.softRebootCapable
3634

37-
# And reboot into it
38-
tmt-reboot
35+
# And reboot into it using systemctl to ensure soft-reboot get's called
36+
# https://tmt.readthedocs.io/en/stable/stories/features.html#reboot-during-test
37+
tmt-reboot -c "systemctl soft-reboot"
3938
}
4039

4140
# The second boot; verify we're in the derived image
4241
def second_boot [] {
4342
assert ("/usr/share/testfile-for-soft-reboot.txt" | path exists)
4443

4544
assert equal (systemctl show -P SoftRebootsCount) "1"
46-
}
47-
48-
# Run on the second boot
49-
def second_build [] {
50-
tap begin "local image push + pull + upgrade"
51-
52-
let td = mktemp -d
53-
cd $td
54-
55-
bootc image copy-to-storage
5645

5746
# A new derived with new kargs which should stop the soft reboot.
5847
"FROM localhost/bootc
@@ -62,8 +51,9 @@ RUN echo 'kargs = ["foo1=bar2"]' | tee /usr/lib/bootc/kargs.d/00-foo1bar2.toml >
6251
# Build it
6352
podman build -t localhost/bootc-derived .
6453

65-
bootc update --queue-soft-reboot --transport containers-storage
54+
bootc update --queue-soft-reboot
6655
let st = bootc status --json | from json
56+
# Should not be soft-reboot capable because of kargs diff
6757
assert (not $st.status.staged.softRebootCapable)
6858

6959
# And reboot into it
@@ -82,8 +72,7 @@ def main [] {
8272
match $env.TMT_REBOOT_COUNT? {
8373
null | "0" => initial_build,
8474
"1" => second_boot,
85-
"2" => second_build,
86-
"3" => third_boot,
75+
"2" => third_boot,
8776
$o => { error make { msg: $"Invalid TMT_REBOOT_COUNT ($o)" } },
8877
}
8978
}

0 commit comments

Comments
 (0)