From: Frantisek Sumsal Date: Mon, 18 Dec 2023 17:02:41 +0000 (+0100) Subject: test: add missing operators X-Git-Tag: v256-rc1~1464 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32c376a46cac5edf937c4b6e52ef8711f2034952;p=thirdparty%2Fsystemd.git test: add missing operators Without them only the last expression's return value is honored, causing unexpected CI fails: [ 26.006721] testsuite-04.sh[1191]: + for _ in {0..9} [ 26.007672] testsuite-04.sh[1191]: + setterm --term linux --dump --file /tmp/console.dump [ 26.008871] testsuite-04.sh[1233]: + SYSTEMD_COLORS=256 [ 26.009606] testsuite-04.sh[1233]: + /usr/lib/systemd/systemd-bsod [ 26.063296] systemd[1]: session-1.scope: Deactivated successfully. [ 26.124789] testsuite-04.sh[1191]: + grep -aq 'Press any key to exit' /tmp/console.dump [ 26.131509] testsuite-04.sh[1191]: + grep -aq 'Root emergency message' /tmp/console.dump [ 26.137882] testsuite-04.sh[1191]: + grep -aq 'The current boot has failed' /tmp/console.dump [ 26.141650] testsuite-04.sh[1191]: + return 0 [ 26.144816] testsuite-04.sh[1191]: + grep -aq 'Scan the QR code' /tmp/console.dump [ 26.153591] testsuite-04.sh[1191]: + at_exit [ 26.154744] testsuite-04.sh[1191]: + local EC=1 [ 26.155697] testsuite-04.sh[1191]: + [[ 1 -ne 0 ]] [ 26.156787] testsuite-04.sh[1191]: + [[ -e /tmp/console.dump ]] [ 26.157799] testsuite-04.sh[1191]: + cat /tmp/console.dump [ 26.158858] testsuite-04.sh[1244]: The current boot has failed! [ 26.159858] testsuite-04.sh[1244]: Root emergency message I'm genuinely impressed that this worked at all. --- diff --git a/test/units/testsuite-04.bsod.sh b/test/units/testsuite-04.bsod.sh index 1de446bc124..1d4ad7ec6a2 100755 --- a/test/units/testsuite-04.bsod.sh +++ b/test/units/testsuite-04.bsod.sh @@ -35,9 +35,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 "Press any key to exit" /tmp/console.dump - grep -aq "$expected_message" /tmp/console.dump - 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 "The current boot has failed" /tmp/console.dump; then return 0 fi