From: Frantisek Sumsal Date: Mon, 27 May 2019 17:59:26 +0000 (+0200) Subject: test: correctly fail when system is borked X-Git-Tag: v243-rc1~374 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0533a319b075115268eea859e11d35153d58265;p=thirdparty%2Fsystemd.git 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. --- diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh index 2314ec37ce5..0f29ad7eda7 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