test: wait for the "latest" systemd-bsod message
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 6 Nov 2023 19:00:09 +0000 (20:00 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 6 Nov 2023 21:01:24 +0000 (21:01 +0000)
commit4457a2e0ee041a156e649b3d2a1b0609b627210f
tree3253c165facf44a7fa382e11cfc740b2a522444c
parentd377949085cede60e038d55487dfb61638666535
test: wait for the "latest" systemd-bsod message

Let's wait for the "latest" message systemd-bsod prints to the console
to appear, otherwise we might be too fast and take a console snapshot
before it contains all the information:

[   44.237788] testsuite-04.sh[1744]: + setterm --term linux --dump --file /tmp/console.dump
[   44.246089] systemd-bsod[1858]: QR code could not be printed, ignoring: Operation not supported
[   44.305692] testsuite-04.sh[1744]: + grep -aq 'The current boot has failed' /tmp/console.dump
[   44.308047] testsuite-04.sh[1744]: + grep -aq 'Service emergency message' /tmp/console.dump
[   44.311200] testsuite-04.sh[1744]: + grep -aq 'Press any key to exit' /tmp/console.dump
[   44.314359] testsuite-04.sh[1744]: + at_exit
[   44.315087] testsuite-04.sh[1744]: + local EC=1
[   44.315945] testsuite-04.sh[1744]: + [[ 1 -ne 0 ]]
[   44.316647] testsuite-04.sh[1744]: + [[ -e /tmp/console.dump ]]
[   44.318305] testsuite-04.sh[1744]: + cat /tmp/console.dump
[   44.319320] testsuite-04.sh[1871]:    The current boot has failed!
[   44.319970] testsuite-04.sh[1871]:    Service emergency message
test/units/testsuite-04.bsod.sh