From d0533a319b075115268eea859e11d35153d58265 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Mon, 27 May 2019 19:59:26 +0200 Subject: [PATCH] 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. --- test/TEST-01-BASIC/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3