test: Shut down tests on crash
authorRichard Maw <richard.maw@codethink.co.uk>
Tue, 23 Apr 2024 13:13:22 +0000 (14:13 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 24 Apr 2024 09:01:45 +0000 (11:01 +0200)
commit2fd849016b7368f64f591833a2be752e68cd5052
tree822b5a7d65eaeb19ef81594be215a429e2a034c6
parent796cf1b4838467b1c2da80aa1101ec236390914d
test: Shut down tests on crash

If an assert in systemd fails it can't shut down normally.

By default it freezes. For interactive runs we want the crash shell
to enable further debugging, but during test runs we want it to exit
without having to wait for the test timeout.

By deactivating the crash shell, enabling reboot, and configuring qemu
so that it shuts down instead of rebooting we can shut down instead.

Because by default UEFI will enroll keys and then reboot
we also have to set --qemu-firmware-variables=custom
so it doesn't need to auto-enroll.

Because mkosi has to handle not receiving an EXIT_STATUS notification
it falls back to the exit code of qemu, which in the case of reboot
would be 0, we also override the success exit status to 123
and check that we got that as an exit code from mkosi.
test/integration-test-wrapper.py