]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fail immediatelly when clean.sh or setup.sh fails
authorOndřej Surý <ondrej@isc.org>
Tue, 12 May 2020 08:01:35 +0000 (10:01 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 12 May 2020 11:20:45 +0000 (13:20 +0200)
The `statschannel/ns2/` was missing `manykeys.db.in`, but the test
succeeded even when `setup.sh` (or `clean.sh`) failed to execute.  This
commit makes run.sh to run in stricter mode and fail the test
immediately when `clean.sh` or `setup.sh` fails.

(cherry picked from commit 8b357a35d2478200f7cccd3f357aa8203bf81c0d)

bin/tests/system/run.sh

index a2bcaff5677873b99b7abe350ef94c93d274909a..f4f8077f6bb3c6149d66ec5e737d2b7c63529e24 100755 (executable)
@@ -194,20 +194,22 @@ fi
 # Clean up files left from any potential previous runs
 if test -f $systest/clean.sh
 then
-    ( cd $systest && $SHELL clean.sh "$@" )
-    ret=$?
-    if [ $ret -ne 0 ]; then
-       echowarn "I:$systest:clean.sh script failed with $ret"
+    if ! ( cd "${systest}" && $SHELL clean.sh "$@" ); then
+       echowarn "I:$systest:clean.sh script failed"
+       echofail "R:$systest:FAIL"
+       echoend  "E:$systest:$(date_with_args)"
+       exit 1
     fi
 fi
 
 # Set up any dynamically generated test data
 if test -f $systest/setup.sh
 then
-    ( cd $systest && $SHELL setup.sh "$@" )
-    ret=$?
-    if [ $ret -ne 0 ]; then
-       echowarn "I:$systest:clean.sh script failed with $ret"
+    if ! ( cd "${systest}" && $SHELL setup.sh "$@" ); then
+       echowarn "I:$systest:setup.sh script failed"
+       echofail "R:$systest:FAIL"
+       echoend  "E:$systest:$(date_with_args)"
+       exit 1
     fi
 fi