mirror of
https://github.com/systemd/systemd
synced 2024-10-15 20:45:09 +00:00
test: shutdown the machine on fail after soft-reboot
Since the soft-reboot drops the enqueued end.service, we won't shutdown the test VM if the test fails and have to wait for the watchdog to kill us (which may take quite a long time). Let's just forcibly kill the machine instead to save CI resources.
This commit is contained in:
parent
16f094cfbb
commit
47f6baccfe
|
@ -3,6 +3,19 @@
|
|||
set -ex
|
||||
set -o pipefail
|
||||
|
||||
at_exit() {
|
||||
# Since the soft-reboot drops the enqueued end.service, we won't shutdown
|
||||
# the test VM if the test fails and have to wait for the watchdog to kill
|
||||
# us (which may take quite a long time). Let's just forcibly kill the machine
|
||||
# instead to save CI resources.
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo >&2 "Test failed, shutting down the machine..."
|
||||
systemctl poweroff -ff
|
||||
fi
|
||||
}
|
||||
|
||||
trap at_exit EXIT
|
||||
|
||||
systemd-analyze log-level debug
|
||||
|
||||
export SYSTEMD_LOG_LEVEL=debug
|
||||
|
|
Loading…
Reference in a new issue