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.
This commit is contained in:
Frantisek Sumsal
2019-05-27 22:31:55 +03:00
committed by Evgeny Vereshchagin
parent 75e4c768e2
commit d0533a319b
+1 -1
View File
@@ -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