Skip to content

Commit 29e5c9a

Browse files
committed
tests: Create a shared workaround for c10s+tmt-reboot
Since other tests are hitting it. Signed-off-by: Colin Walters <[email protected]>
1 parent 1ad391e commit 29e5c9a

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

tmt/tests/booted/bootc_testlib.nu

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# A simple nushell "library" for the
2+
3+
# This is a workaround for what must be a systemd bug
4+
# that seems to have appeared in C10S
5+
# TODO diagnose and fill in here
6+
export def reboot [] {
7+
# Sometimes systemd daemons are still running old binaries and response "Access denied" when send reboot request
8+
# Force a full sync before reboot
9+
sync
10+
# Allow more delay for bootc to settle
11+
sleep 30sec
12+
13+
tmt-reboot
14+
}

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std assert
22
use tap.nu
3+
use bootc_testlib.nu
34

45
def initial_build [] {
56
tap begin "factory reset test"
@@ -41,16 +42,7 @@ def initial_build [] {
4142
# nu's cp doesn't have -T
4243
/usr/bin/cp -r -T $workdir_root $"($new_stateroot_path)/($workdir_root)"
4344

44-
# Check reset status before reboot
45-
RUST_LOG=trace bootc status
46-
47-
# Sometimes systemd daemons are still running old binaries and response "Access denied" when send reboot request
48-
# Force a full sync before reboot
49-
sync
50-
# Allow more delay for bootc to settle
51-
sleep 30sec
52-
53-
tmt-reboot
45+
bootc_testlib reboot
5446
}
5547

5648
# The second boot; verify we're in the factory reset deployment

tmt/tests/booted/test-usroverlay.nu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Verify that bootc usroverlay works
22
use std assert
33
use tap.nu
4+
use bootc_testlib.nu
45

56
bootc status
67

@@ -12,8 +13,8 @@ def initial_run [] {
1213
bootc usroverlay
1314
let is_writable = (do -i { /bin/test -w /usr } | complete | get exit_code) == 0
1415
assert ($is_writable)
15-
16-
tmt-reboot
16+
17+
bootc_testlib reboot
1718
}
1819

1920
# The second boot; verify we're in the derived image

0 commit comments

Comments
 (0)