diff --git a/bin/tests/system/nsupdate/clean.sh b/bin/tests/system/nsupdate/clean.sh index 42d0871c40..2034aa46ab 100644 --- a/bin/tests/system/nsupdate/clean.sh +++ b/bin/tests/system/nsupdate/clean.sh @@ -58,6 +58,7 @@ rm -f ns9/_default.tsigkeys rm -f ns9/denyname.example.db rm -f ns9/example.com.db rm -f ns9/in-addr.db +rm -f perl.update_test.out rm -f nsupdate.out* rm -f typelist.out.* rm -f update.out.* diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index f4bb75375a..d2bb3bfe56 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -304,36 +304,43 @@ elif [ "$serial" -gt "$now" ]; then fi [ $ret = 0 ] || { echo_i "failed"; status=1; } -ret=0 if $PERL -e 'use Net::DNS;' 2>/dev/null then - echo_i "running update.pl test" - { - $PERL update_test.pl -s 10.53.0.1 -p ${PORT} update.nil. || ret=1 - } | cat_i + n=`expr $n + 1` + ret=0 + echo_i "running update.pl test ($n)" + $PERL update_test.pl -s 10.53.0.1 -p ${PORT} update.nil. > perl.update_test.out || ret=1 + [ $ret -eq 1 ] && { echo_i "failed"; status=1; } + if $PERL -e 'use Net::DNS; die "Net::DNS too old ($Net::DNS::VERSION < 1.01)" if ($Net::DNS::VERSION < 1.01)' > /dev/null then - grep "updating zone 'update.nil/IN': too many NSEC3 iterations (151)" ns1/named.run > /dev/null || ret=1 + n=`expr $n + 1` + ret=0 + echo_i "check for too many NSEC3 iterations log ($n)" + grep "updating zone 'update.nil/IN': too many NSEC3 iterations (151)" ns1/named.run > /dev/null || ret=1 + [ $ret -eq 1 ] && { echo_i "failed"; status=1; } fi - [ $ret -eq 1 ] && { echo_i "failed"; status=1; } else echo_i "The second part of this test requires the Net::DNS library." >&2 fi +n=`expr $n + 1` ret=0 -echo_i "fetching first copy of test zone" +echo_i "fetching first copy of test zone ($n)" $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.nil.\ @10.53.0.1 axfr > dig.out.ns1 || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } +n=`expr $n + 1` ret=0 -echo_i "fetching second copy of test zone" +echo_i "fetching second copy of test zone ($n)" $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.nil.\ @10.53.0.2 axfr > dig.out.ns2 || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } +n=`expr $n + 1` ret=0 -echo_i "comparing zones" +echo_i "comparing zones ($n)" digcomp dig.out.ns1 dig.out.ns2 || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } @@ -353,21 +360,24 @@ else fi sleep 10 +n=`expr $n + 1` ret=0 -echo_i "fetching ns1 after hard restart" +echo_i "fetching ns1 after hard restart ($n)" $DIG $DIGOPTS +tcp +noadd +nosea +nostat +noquest +nocomm +nocmd example.nil.\ @10.53.0.1 axfr > dig.out.ns1.after || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } +n=`expr $n + 1` ret=0 -echo_i "comparing zones" +echo_i "comparing zones ($n)" digcomp dig.out.ns1 dig.out.ns1.after || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } echo_i "begin RT #482 regression test" +n=`expr $n + 1` ret=0 -echo_i "update primary" +echo_i "update primary ($n)" $NSUPDATE -k ns1/ddns.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add updated2.example.nil. 600 A 10.10.10.2 @@ -389,8 +399,9 @@ fi sleep 5 +n=`expr $n + 1` ret=0 -echo_i "update primary again" +echo_i "update primary again ($n)" $NSUPDATE -k ns1/ddns.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add updated3.example.nil. 600 A 10.10.10.3 @@ -412,7 +423,8 @@ fi sleep 5 -echo_i "check to 'out of sync' message" +n=`expr $n + 1` +echo_i "check to 'out of sync' message ($n)" if grep "out of sync" ns2/named.run then echo_i "failed (found 'out of sync')" diff --git a/bin/tests/system/nsupdate/update_test.pl b/bin/tests/system/nsupdate/update_test.pl index 720a6b89ff..987c210763 100644 --- a/bin/tests/system/nsupdate/update_test.pl +++ b/bin/tests/system/nsupdate/update_test.pl @@ -58,7 +58,7 @@ sub assert { my ($cond, $explanation) = @_; if (!$cond) { print "Test Failed: $explanation ***\n"; - $failures++ + $failures++; } } @@ -79,6 +79,7 @@ sub test { assert($rcode eq $expected, "expected $expected, got $rcode"); } else { print "Update failed: ", $res->errorstring, "\n"; + $failures++; } }