From 245730cf78fdcd729a13260cb32cccbb029ee82b Mon Sep 17 00:00:00 2001 From: Tom Krizek Date: Mon, 19 Jun 2023 16:11:16 +0200 Subject: [PATCH] Handle non-zero return codes in nsupdate test (cherry picked from commit 86765ad1d3d7049d93243526e4c989b943bf1266) --- bin/tests/system/nsupdate/tests.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index 3e7604791c..54e7a4ede6 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -581,7 +581,7 @@ done ret=0 echo_i "check that 'nsupdate -l' with a missing keyfile reports the missing file" -$NSUPDATE -4 -p ${PORT} -l -k ns1/nonexistent.key 2> nsupdate.out < /dev/null +$NSUPDATE -4 -p ${PORT} -l -k ns1/nonexistent.key 2> nsupdate.out < /dev/null && ret=1 grep ns1/nonexistent.key nsupdate.out > /dev/null || ret=1 if test $ret -ne 0 then @@ -631,7 +631,7 @@ fi n=$((n + 1)) ret=0 echo_i "check that 'update-policy tcp-self' refuses update of records via UDP ($n)" -$NSUPDATE > nsupdate.out.$n 2>&1 << END +$NSUPDATE > nsupdate.out.$n 2>&1 << END && ret=1 server 10.53.0.6 ${PORT} local 127.0.0.1 update add 1.0.0.127.in-addr.arpa. 600 PTR localhost. @@ -669,7 +669,7 @@ fi n=$((n + 1)) ret=0 echo_i "check that 'update-policy tcp-self' refuses update of records for a different address from the client's own address via TCP ($n)" -$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 127.0.0.1 update add 1.0.168.192.in-addr.arpa. 600 PTR localhost. @@ -1039,23 +1039,23 @@ retry_quiet 20 check_size_lt_5000 || ret=1 n=$((n + 1)) echo_i "check check-names processing ($n)" ret=0 -$NSUPDATE << EOF > nsupdate.out1-$n 2>&1 +$NSUPDATE << EOF > nsupdate.out1-$n 2>&1 && ret=1 update add # 0 in a 1.2.3.4 EOF grep "bad owner" nsupdate.out1-$n > /dev/null || ret=1 -$NSUPDATE << EOF > nsupdate.out2-$n 2>&1 +$NSUPDATE << EOF > nsupdate.out2-$n 2>&1 || ret=1 check-names off update add # 0 in a 1.2.3.4 EOF grep "bad owner" nsupdate.out2-$n > /dev/null && ret=1 -$NSUPDATE << EOF > nsupdate.out3-$n 2>&1 +$NSUPDATE << EOF > nsupdate.out3-$n 2>&1 && ret=1 update add . 0 in mx 0 # EOF grep "bad name" nsupdate.out3-$n > /dev/null || ret=1 -$NSUPDATE << EOF > nsupdate.out4-$n 2>&1 +$NSUPDATE << EOF > nsupdate.out4-$n 2>&1 || ret=1 check-names off update add . 0 in mx 0 # EOF @@ -1479,7 +1479,7 @@ n=$((n + 1)) ret=0 echo_i "check that update is rejected if query is not allowed ($n)" { - $NSUPDATE -d <