diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2019-05-27 19:59:26 +0200 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2019-05-27 22:31:55 +0300 |
commit | d0533a319b075115268eea859e11d35153d58265 (patch) | |
tree | d91c3f65801b2fc05dd731ebd9bbca250f58e5b0 /test/TEST-01-BASIC | |
parent | 75e4c768e212cc66a78b05ce70a2871e133833cb (diff) | |
download | systemd-d0533a319b075115268eea859e11d35153d58265.tar.gz |
test: correctly fail when system is borked
In certain situations, the systemctl commands may fail (e.g. due to
missing shared libraries), but the 'script' continues and creates a
/testok file, marking the test incorrectly as passed. Let's fix this and
bail out immediately when a command exits with a non-zero exit code.
Diffstat (limited to 'test/TEST-01-BASIC')
-rwxr-xr-x | test/TEST-01-BASIC/test.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 2314ec37ce..0f29ad7eda 100755 --- a/test/TEST-01-BASIC/test.sh +++ b/test/TEST-01-BASIC/test.sh @@ -24,7 +24,7 @@ Description=Testsuite service After=multi-user.target [Service] -ExecStart=/bin/sh -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok' +ExecStart=/bin/sh -e -x -c 'systemctl --state=failed --no-legend --no-pager > /failed ; systemctl daemon-reload ; echo OK > /testok' Type=oneshot EOF |