]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check exit status of dig and nsupdate in nsupdate system test
authorMark Andrews <marka@isc.org>
Thu, 19 Mar 2026 04:18:46 +0000 (15:18 +1100)
committerOndřej Surý <ondrej@isc.org>
Tue, 7 Apr 2026 14:21:45 +0000 (16:21 +0200)
Add missing `|| ret=1` to six dig and nsupdate invocations in
tests.sh so that command failures are properly caught instead
of silently ignored.

bin/tests/system/nsupdate/tests.sh

index 808a019bb7197871b7cd0cf94d8e1de1412aaafd..7a77faea6beefce4ee8d335bef9672f2b1352bda 100755 (executable)
@@ -913,7 +913,7 @@ END
 grep REFUSED nsupdate.out.$n >/dev/null 2>&1 || ret=1
 $DIG $DIGOPTS @10.53.0.6 \
   +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
-  -x 127.0.0.1 >dig.out.ns6.$n
+  -x 127.0.0.1 >dig.out.ns6.$n || ret=1
 grep localhost. dig.out.ns6.$n >/dev/null 2>&1 && ret=1
 if test $ret -ne 0; then
   echo_i "failed"
@@ -981,7 +981,7 @@ END
 grep REFUSED nsupdate.out.$n >/dev/null 2>&1 || ret=1
 $DIG $DIGOPTS @10.53.0.6 \
   +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
-  -x 192.168.0.1 >dig.out.ns6.$n
+  -x 192.168.0.1 >dig.out.ns6.$n || ret=1
 grep localhost. dig.out.ns6.$n >/dev/null 2>&1 && ret=1
 if test $ret -ne 0; then
   echo_i "failed"
@@ -1020,7 +1020,7 @@ END
 grep REFUSED nsupdate.out.$n >/dev/null 2>&1 || ret=1
 $DIG $DIGOPTS @10.53.0.6 \
   +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
-  $REVERSE_NAME NS >dig.out.ns6.$n
+  $REVERSE_NAME NS >dig.out.ns6.$n || ret=1
 grep localhost. dig.out.ns6.$n >/dev/null 2>&1 && ret=1
 if test $ret -ne 0; then
   echo_i "failed"
@@ -1092,7 +1092,7 @@ END
 grep REFUSED nsupdate.out.$n >/dev/null 2>&1 || ret=1
 $DIG $DIGOPTS @fd92:7065:b8e:ffff::6 \
   +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
-  $REVERSE_NAME NS >dig.out.ns6.$n
+  $REVERSE_NAME NS >dig.out.ns6.$n || ret=1
 grep localhost. dig.out.ns6.$n >/dev/null 2>&1 && ret=1
 if test $ret -ne 0; then
   echo_i "failed"
@@ -2143,7 +2143,7 @@ n=$((n + 1))
 ret=0
 echo_i "check that max records is enforced ($n)"
 nextpart ns6/named.run >/dev/null
-$NSUPDATE -v >nsupdate.out.$n 2>&1 <<END
+$NSUPDATE -v >nsupdate.out.$n 2>&1 <<END || ret=1
 server 10.53.0.6 ${PORT}
 local 10.53.0.5
 update del 5.0.53.10.in-addr.arpa.
@@ -2169,7 +2169,7 @@ n=$((n + 1))
 ret=0
 echo_i "check that max records for ANY is enforced ($n)"
 nextpart ns6/named.run >/dev/null
-$NSUPDATE -v >nsupdate.out.$n 2>&1 <<END
+$NSUPDATE -v >nsupdate.out.$n 2>&1 <<END || ret=1
 server 10.53.0.6 ${PORT}
 local 10.53.0.5
 update del 5.0.53.10.in-addr.arpa.