From: Frantisek Sumsal Date: Mon, 6 Nov 2023 19:00:09 +0000 (+0100) Subject: test: wait for the "latest" systemd-bsod message X-Git-Tag: v255-rc2~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4457a2e0ee041a156e649b3d2a1b0609b627210f;p=thirdparty%2Fsystemd.git 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 --- diff --git a/test/units/testsuite-04.bsod.sh b/test/units/testsuite-04.bsod.sh index 6abdd272cec..774707d476b 100755 --- a/test/units/testsuite-04.bsod.sh +++ b/test/units/testsuite-04.bsod.sh @@ -32,9 +32,9 @@ vcs_dump_and_check() { # so try it a couple of times for _ in {0..9}; do setterm --term linux --dump --file /tmp/console.dump - if grep -aq "The current boot has failed" /tmp/console.dump; then + if grep -aq "Press any key to exit" /tmp/console.dump grep -aq "$expected_message" /tmp/console.dump - grep -aq "Press any key to exit" /tmp/console.dump + grep -aq "The current boot has failed" /tmp/console.dump; then return 0 fi