test: reorder the machinectl signal tests
So the multiple-machines tests run last to avoid a race where the checked signal would get ignored while the stub init is still processing the previous signals: [ 17.380417] testsuite-13.sh[376]: + machinectl reboot long-running long-running long-running [ 17.389888] systemd-nspawn[495]: ++ touch /reboot [ 17.390904] testsuite-13.sh[376]: + rm -f /var/lib/machines/long-running/trap [ 17.393937] testsuite-13.sh[376]: + machinectl kill --signal=SIGTRAP --kill-whom=leader long-running [ 17.408905] testsuite-13.sh[376]: + timeout 10 bash -c 'while ! test -e /var/lib/machines/long-running/trap; do sleep .5; done' [ 27.413210] testsuite-13.sh[376]: + at_exit ... [ 27.993376] testsuite-13.sh[373]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-13.machinectl.sh failed'
This commit is contained in:
committed by
Luca Boccassi
parent
db1264a811
commit
fab73dad84
@@ -91,16 +91,17 @@ machinectl disable long-running long-running long-running container1
|
||||
rm -f /var/lib/machines/long-running/poweroff
|
||||
machinectl poweroff long-running
|
||||
timeout 10 bash -c "while ! test -e /var/lib/machines/long-running/poweroff; do sleep .5; done"
|
||||
machinectl poweroff long-running long-running long-running
|
||||
# Equivalent to machinectl kill --signal=SIGINT --kill-whom=leader
|
||||
rm -f /var/lib/machines/long-running/reboot
|
||||
machinectl reboot long-running
|
||||
timeout 10 bash -c "while ! test -e /var/lib/machines/long-running/reboot; do sleep .5; done"
|
||||
machinectl reboot long-running long-running long-running
|
||||
# Skip machinectl terminate for now, as it doesn't play well with our "init"
|
||||
rm -f /var/lib/machines/long-running/trap
|
||||
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running
|
||||
timeout 10 bash -c "while ! test -e /var/lib/machines/long-running/trap; do sleep .5; done"
|
||||
# Multiple machines at once
|
||||
machinectl poweroff long-running long-running long-running
|
||||
machinectl reboot long-running long-running long-running
|
||||
machinectl kill --signal=SIGTRAP --kill-whom=leader long-running long-running long-running
|
||||
# All used signals should've been caught by a handler
|
||||
[[ "$(machinectl show --property=State --value long-running)" == "running" ]]
|
||||
|
||||
Reference in New Issue
Block a user