diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-07 23:24:25 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-04-08 11:45:59 +0200 |
commit | ffa328f060f437f3e1f0f0cb13513ee3dd9c3da5 (patch) | |
tree | f5de9f56fa6c5347315619ee24fb64bd76ea3af7 /test/units/testsuite-30.sh | |
parent | 65d09d575cf74c34098ff4f3ab53fc7587805811 (diff) | |
download | systemd-ffa328f060f437f3e1f0f0cb13513ee3dd9c3da5.tar.gz |
tests: make inverted tests actually count
"! test ..." does not cause the script to fail, even with set -e.
IIUC, bash treats this command as part of an expression line, as it
would if 'test ... && ...' was used. Failing expression lines do not
terminate the script.
This fixes the obvious cases by changing '! test' → 'test !'.
Then the inversion happens internally in test and bash will propagate
the failure.
Diffstat (limited to 'test/units/testsuite-30.sh')
-rwxr-xr-x | test/units/testsuite-30.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/units/testsuite-30.sh b/test/units/testsuite-30.sh index a507ffcd7b..425f153c3b 100755 --- a/test/units/testsuite-30.sh +++ b/test/units/testsuite-30.sh @@ -13,16 +13,16 @@ timedatectl set-time 1980-10-15 systemd-run --on-timezone-change touch /tmp/timezone-changed systemd-run --on-clock-change touch /tmp/clock-changed -! test -f /tmp/timezone-changed -! test -f /tmp/clock-changed +test ! -f /tmp/timezone-changed +test ! -f /tmp/clock-changed timedatectl set-timezone Europe/Kiev -while ! test -f /tmp/timezone-changed ; do sleep .5 ; done +while test ! -f /tmp/timezone-changed ; do sleep .5 ; done timedatectl set-time 2018-1-1 -while ! test -f /tmp/clock-changed ; do sleep .5 ; done +while test ! -f /tmp/clock-changed ; do sleep .5 ; done systemd-analyze log-level info |