mirror of
https://github.com/containers/bootc.git
synced 2026-02-05 06:45:13 +01:00
tmt: Document soft-reboot limitation and fix tests
TMT does not support systemd soft-reboots - it only detects reboots by checking if /proc/stat btime changes, which doesn't happen during soft-reboots. This caused test-custom-selinux-policy to hang when running with bcvk (which allows actual soft-reboots), while it accidentally passed with testcloud (which forced full VM reboots). Add bug-soft-reboot.md documenting this limitation and update both test files to reference it. Also remove --soft-reboot=auto from test-custom-selinux-policy since we can't test it with TMT anyway. Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
35
tmt/bug-soft-reboot.md
Normal file
35
tmt/bug-soft-reboot.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# TMT soft-reboot limitation
|
||||
|
||||
TMT does not currently support systemd soft-reboots. It detects reboots by checking
|
||||
if the `/proc/stat` btime (boot time) field changes, which does not happen during
|
||||
a systemd soft-reboot.
|
||||
|
||||
See: <https://github.com/teemtee/tmt/issues/3143>
|
||||
|
||||
Note: This same issue affects Testing Farm as documented in `plans/integration.fmf`
|
||||
where `test-27-custom-selinux-policy` is disabled for Packit (AWS) testing.
|
||||
|
||||
## Impact on bootc testing
|
||||
|
||||
This means that when testing `bootc switch --soft-reboot=auto` or `bootc upgrade --soft-reboot=auto`:
|
||||
|
||||
1. The bootc commands will correctly prepare for a soft-reboot (staging the deployment in `/run/nextroot`)
|
||||
2. However, TMT cannot detect or properly handle the soft-reboot
|
||||
3. Tests must explicitly reset the soft-reboot preparation before calling `tmt-reboot`
|
||||
|
||||
## Workaround
|
||||
|
||||
After calling bootc with `--soft-reboot=auto`, use:
|
||||
|
||||
```nushell
|
||||
ostree admin prepare-soft-reboot --reset
|
||||
tmt-reboot
|
||||
```
|
||||
|
||||
This forces a full reboot instead of a soft-reboot, which TMT can properly detect.
|
||||
|
||||
## Testing environments
|
||||
|
||||
- **testcloud**: Accidentally worked because libvirt forced a full VM power cycle, overriding systemd's soft-reboot attempt
|
||||
- **bcvk**: Exposes the real issue because it allows actual systemd soft-reboots
|
||||
- **Production (AWS, bare metal, etc.)**: Not affected - TMT is purely a testing framework; soft-reboots work correctly in production
|
||||
@@ -104,7 +104,7 @@ execute:
|
||||
adjust:
|
||||
- when: running_env != image_mode
|
||||
enabled: false
|
||||
because: tmt-reboot does not work with systemd reboot in testing farm environment
|
||||
because: tmt-reboot does not work with systemd reboot in testing farm environment (see bug-soft-reboot.md)
|
||||
|
||||
/test-28-factory-reset:
|
||||
summary: Factory reset
|
||||
|
||||
@@ -22,10 +22,11 @@ RUN mkdir /opt123; echo \"/opt123 /opt\" >> /etc/selinux/targeted/contexts/files
|
||||
# Build it
|
||||
podman build -t localhost/bootc-derived .
|
||||
|
||||
bootc switch --soft-reboot=auto --transport containers-storage localhost/bootc-derived
|
||||
bootc switch --transport containers-storage localhost/bootc-derived
|
||||
|
||||
assert (not ("/opt123" | path exists))
|
||||
|
||||
# See ../bug-soft-reboot.md - TMT cannot handle systemd soft-reboots
|
||||
# https://tmt.readthedocs.io/en/stable/stories/features.html#reboot-during-test
|
||||
tmt-reboot
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ RUN echo test content > /usr/share/testfile-for-soft-reboot.txt
|
||||
|
||||
assert ("/run/nextroot" | path exists)
|
||||
|
||||
#Let's reset the soft-reboot as we still can't correctly soft-reboot with tmt
|
||||
# See ../bug-soft-reboot.md - TMT cannot handle systemd soft-reboots
|
||||
ostree admin prepare-soft-reboot --reset
|
||||
# https://tmt.readthedocs.io/en/stable/stories/features.html#reboot-during-test
|
||||
tmt-reboot
|
||||
@@ -45,9 +45,7 @@ RUN echo test content > /usr/share/testfile-for-soft-reboot.txt
|
||||
# The second boot; verify we're in the derived image
|
||||
def second_boot [] {
|
||||
assert ("/usr/share/testfile-for-soft-reboot.txt" | path exists)
|
||||
#tmt-reboot seems not to be using systemd soft-reboot
|
||||
# and tmt-reboot -c "systemctl soft-reboot" is not connecting back
|
||||
# let's comment this check.
|
||||
# See ../bug-soft-reboot.md - we can't verify SoftRebootsCount due to TMT limitation
|
||||
#assert equal (systemctl show -P SoftRebootsCount) "1"
|
||||
|
||||
# A new derived with new kargs which should stop the soft reboot.
|
||||
|
||||
Reference in New Issue
Block a user