Commit 3635d8f9 authored by Mark Andrews's avatar Mark Andrews

do not overflow exit status. [RT #42643]

parent ecff557e
......@@ -181,4 +181,4 @@ $DIG example. soa @10.53.0.2 +subnet="192.0.2.128/32" -p 5300 > dig.out.${t}
grep "CLIENT-SUBNET.*192.0.2.128/32/24" dig.out.${t} > /dev/null || { echo "I:test $t failed" ; status=1; }
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -139,4 +139,5 @@ if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -381,4 +381,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -630,5 +630,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -1217,4 +1217,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -123,4 +123,5 @@ $DIG +norec +nsid foo @10.53.0.3 -p 5300 > dig.out.ns3.$n
grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.$n > /dev/null || ret=1
if [ $ret != 0 ] ; then echo I:failed; status=`expr $status + $ret`; fi
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -225,4 +225,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -137,5 +137,7 @@ echo "I:check A owner case is transfered to slave ($n)"
ret=0
$DIG axfr dynamic @10.53.0.2 -p 5300 > dig.ns2.test$n
$PERL ../digcomp.pl dig.ns2.test$n postns1.good || ret=1
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -373,4 +373,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -293,4 +293,4 @@ if [ $ret != 0 ]; then echo "I:failed"; ret=1; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -176,4 +176,4 @@ status=`expr $status + $ret`
if [ $status = 0 ]; then $SHELL clean.sh; fi
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -151,4 +151,5 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -171,4 +171,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -137,4 +137,4 @@ status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -81,4 +81,4 @@ for dir in [0-9][0-9]-*; do
done
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -57,4 +57,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -68,4 +68,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
rm -f dig.out.test*
rm -f dig.out.*test*
rm -f delv.out.test*
rm -f */named.memstats
rm -f */named.run
......
......@@ -263,7 +263,7 @@ if [ -x ${DIG} ] ; then
echo "I:checking dig +subnet with various prefix lengths ($n)"
ret=0
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24; do
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=255.255.255.255/$i A a.example > dig.out.test$n 2>&1 || ret=1
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=255.255.255.255/$i A a.example > dig.out.$i.test$n 2>&1 || ret=1
case $i in
1|9|17) octet=128 ;;
2|10|18) octet=192 ;;
......@@ -279,8 +279,8 @@ if [ -x ${DIG} ] ; then
9|10|11|12|13|14|15|16) addr="255.${octet}.0.0";;
17|18|19|20|21|22|23|24) addr="255.255.${octet}.0" ;;
esac
grep "FORMERR" < dig.out.test.$p.$n > /dev/null && ret=1
grep "CLIENT-SUBNET: $addr/$i/0" < dig.out.test$n > /dev/null || ret=1
grep "FORMERR" < dig.out.$i.test$n > /dev/null && ret=1
grep "CLIENT-SUBNET: $addr/$i/0" < dig.out.$i.test$n > /dev/null || ret=1
done
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
......@@ -510,7 +510,8 @@ if [ -x ${DELV} ] ; then
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
else
echo "$DELV is needed, so skipping these delv tests"
fi
......@@ -59,4 +59,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -62,4 +62,5 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -79,4 +79,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -202,4 +202,5 @@ lookups=`grep "lookup #.*\.not\.there" ns1/named.run | wc -l`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -65,4 +65,4 @@ status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -1370,4 +1370,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -3295,4 +3295,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -174,4 +174,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -38,4 +38,6 @@ do
done
test $ret = 0 || { echo "I:failed"; status=`expr $status + $ret`; }
done
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -56,4 +56,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -147,4 +147,5 @@ status=`expr $status + $ret`
test_del test6.ipv6.example.nil. AAAA || ret=1
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -39,4 +39,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -111,4 +111,4 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -40,4 +40,5 @@ grep "status: REFUSED" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -183,4 +183,4 @@ if [ $ret != 0 ]; then echo "I: failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -1381,4 +1381,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -46,4 +46,4 @@ fi
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -138,4 +138,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -485,4 +485,4 @@ $CHECKCONF options.conf || ret=1
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -43,4 +43,4 @@ $DIG +norec @10.53.0.1 -p 5300 example.net. a > dig.out || status=1
$PERL ../digcomp.pl noglue.good dig.out || status=1
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -39,4 +39,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -979,4 +979,5 @@ serial=`awk '$4 == "SOA" { print $7 }' dig.out.ns2.post.test$n`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -266,4 +266,4 @@ if [ ${ret} != 0 ]; then
fi
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -103,4 +103,4 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -169,4 +169,4 @@ fi
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -57,4 +57,4 @@ grep 'flags: .*tc.*;' dig.out.exceed > /dev/null || {
}
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -268,4 +268,4 @@ else
fi
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -71,4 +71,4 @@ fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -63,4 +63,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -290,4 +290,4 @@ grep 'next resign' rndc.out > /dev/null 2>&1 || ret=1
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -192,4 +192,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -543,4 +543,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -48,4 +48,4 @@ if [ $val -le 1 ]; then
fi;
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -213,4 +213,4 @@ grep "test string" dig.out.c.ns5.test$n > /dev/null || ret=1
status=`expr $ret + $status`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -32,5 +32,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -657,4 +657,4 @@ grep "bad name" nsupdate.out4-$n > /dev/null && ret=1
[ $ret = 0 ] || { echo I:failed; status=1; }
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -201,4 +201,4 @@ test $ret = 0 || echo I:failed, got "'""$ans""'", expected "'""$expect""'"
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -60,4 +60,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -79,4 +79,4 @@ END
done
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -66,4 +66,4 @@ if [ $count != 0 ]; then echo "I:failed"; fi
status=`expr $status + $count`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -190,4 +190,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -525,4 +525,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -688,5 +688,6 @@ ttl=`awk '/"A" "zero" "ttl"/ { print $2 }' dig.out.1.${n}`
test ${ttl:-1} -eq 0 || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -557,4 +557,5 @@ EOF
status=`expr $status + $ret`
fi
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -647,4 +647,4 @@ $DIG -p 5300 @$ns3 ns example.com > dig.out.delegation
grep "status: SERVFAIL" dig.out.delegation > /dev/null || setret "I:failed"
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -335,5 +335,5 @@ if test $p1 -le $p2; then ret=1; fi
if test $ret != 0; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -79,4 +79,4 @@ done
test $ret -eq 0 || { echo "I:failed"; status=`expr $status + 1`; }
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -284,6 +284,6 @@ if [ -f named.pid ]; then
fi
echo "I:exit status: $ret"
exit $ret
[ $ret -eq 0 ] || exit 1
#[ $ret -ne 0 ] && echo "I:test failure overridden"
#exit 0
#[ $status -eq 0 ] || exit 1
......@@ -475,4 +475,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -59,4 +59,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -58,4 +58,5 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
......@@ -97,4 +97,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -343,4 +343,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -57,4 +57,4 @@ $DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
egrep '10.53.0.5$' >> test2.out || status=1
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -39,4 +39,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -214,4 +214,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -143,4 +143,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -210,4 +210,4 @@ status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -40,4 +40,4 @@ echo "I:killing reload loop"
kill `cat reload.pid`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -67,4 +67,4 @@ $PERL ../digcomp.pl knowngood.dig.out.rec dig.out.ns3 || ret=1
done
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -58,4 +58,4 @@ if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -150,4 +150,4 @@ fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status
[ $status -eq 0 ] || exit 1
......@@ -244,4 +244,5 @@ if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
exit $status
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1