From: Evan Hunt Date: Sat, 22 May 2021 02:33:54 +0000 (-0700) Subject: extend rndc timeout to 60 seconds X-Git-Tag: v9.17.14~32^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ed35b3035922b6397be91c76cedec9ed60473e3;p=thirdparty%2Fbind9.git extend rndc timeout to 60 seconds the idle timeout for rndc connections was set to 10 seconds, but this caused intermittent system failures of the 'rndc' system test on slow platforms, since 'rndc reconfig' could time out before reconfiguration was complete. this commit restores the original timeout value of 60 seconds, which was changed inadvertently after rndc was updated to use the network manager. even with this change, however, the test can still time out under TSAN because loading the huge zone can take a very long time (upwards of two minutes). so the test is modified here to generate a smaller zone file when running under TSAN. --- diff --git a/CHANGES b/CHANGES index a2d6de8d31a..039f9572db1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5646. [bug] The default TCP timeout for rndc has been increased + to 60 seconds. This was its original value, but it + had been inadvertently lowered to 10. [GL #2643] + 5645. [cleanup] Remove the rarely-used dns_name_copy() function and rename dns_name_copynf() to dns_name_copy(). [GL !5081] diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c index fe30895f998..88ea9f3ab88 100644 --- a/bin/rndc/rndc.c +++ b/bin/rndc/rndc.c @@ -601,7 +601,7 @@ rndc_startconnect(isc_sockaddr_t *addr) { atomic_fetch_add_relaxed(&connects, 1); isc_nm_tcpconnect(netmgr, (isc_nmiface_t *)local, (isc_nmiface_t *)addr, - rndc_connected, &rndc_ccmsg, 10000, 0); + rndc_connected, &rndc_ccmsg, 60000, 0); } static void diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh index 88c05045af4..4c65acec8e2 100644 --- a/bin/tests/system/rndc/setup.sh +++ b/bin/tests/system/rndc/setup.sh @@ -16,7 +16,14 @@ $SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 >ns2/other.db $SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 >ns2/static.db $SHELL ${TOP_SRCDIR}/bin/tests/system/genzone.sh 2 >ns6/huge.zone.db -awk 'END { for (i = 1; i <= 1000000; i++) + +# we make the huge zone less huge if we're running under +# TSAN, to give the test a fighting chance not to time out. +size=1000000 +if $FEATURETEST --tsan; then + size=250000 +fi +awk 'END { for (i = 1; i <= '${size}'; i++) printf "host%d IN A 10.53.0.6\n", i; }' < /dev/null >> ns6/huge.zone.db copy_setports ns2/named.conf.in ns2/named.conf diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh index e71e07029c8..6065ade8b81 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh @@ -18,7 +18,7 @@ RNDCCMD="$RNDC -p ${CONTROLPORT} -c ../common/rndc.conf -s" status=0 n=0 -n=`expr $n + 1` +n=$((n+1)) echo_i "preparing ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > /dev/null 2>&1 < /dev/null 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking journal file is still present ($n)" ret=0 [ -s ns2/nil.db.jnl ] || { echo_i "'test -s ns2/nil.db.jnl' failed when it shouldn't have"; ret=1; } if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone not writable ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > /dev/null 2>&1 < dig.out.1.test$n grep 'addition 2' dig.out.1.test$n >/dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) echo_i "rndc thaw" $RNDCCMD 10.53.0.2 thaw | sed 's/^/ns2 /' | cat_i -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone now writable ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > nsupdate.out.1.test$n 2>&1 < dig.out.1.test$n grep 'addition 3' dig.out.1.test$n >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) echo_i "rndc sync" ret=0 $RNDCCMD 10.53.0.2 sync nil | sed 's/^/ns2 /' | cat_i -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone was dumped ($n)" ret=0 for i in 1 2 3 4 5 6 7 8 9 10 @@ -109,18 +109,18 @@ do done grep "addition 3" ns2/nil.db > /dev/null 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking journal file is still present ($n)" ret=0 [ -s ns2/nil.db.jnl ] || { echo_i "'test -s ns2/nil.db.jnl' failed when it shouldn't have"; ret=1; } if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone is still writable ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > nsupdate.out.1.test$n 2>&1 < dig.out.1.test$n grep 'addition 4' dig.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) echo_i "rndc sync -clean" ret=0 $RNDCCMD 10.53.0.2 sync -clean nil | sed 's/^/ns2 /' | cat_i -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone was dumped ($n)" ret=0 for i in 1 2 3 4 5 6 7 8 9 10 @@ -149,18 +149,18 @@ do done grep "addition 4" ns2/nil.db > /dev/null 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking journal file is deleted ($n)" ret=0 [ -s ns2/nil.db.jnl ] && { echo_i "'test -s ns2/nil.db.jnl' failed when it shouldn't have"; ret=1; } if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking zone is still writable ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > /dev/null 2>&1 < dig.out.1.test$n grep 'addition 4' dig.out.1.test$n >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking other journal files not removed ($n)" ret=0 [ -s ns2/other.db.jnl ] || { echo_i "'test -s ns2/other.db.jnl' failed when it shouldn't have"; ret=1; } if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) echo_i "cleaning all zones ($n)" $RNDCCMD 10.53.0.2 sync -clean | sed 's/^/ns2 /' | cat_i -n=`expr $n + 1` +n=$((n+1)) echo_i "checking all journals removed ($n)" ret=0 [ -s ns2/nil.db.jnl ] && { @@ -197,17 +197,17 @@ ret=0 echo_i "'test -s ns2/other.db.jnl' succeeded when it shouldn't have"; ret=1; } if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking that freezing static zones is not allowed ($n)" ret=0 $RNDCCMD 10.53.0.2 freeze static > rndc.out.1.test$n 2>&1 grep 'not dynamic' rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking that journal is removed when serial is changed before thaw ($n)" ret=0 sleep 1 @@ -227,7 +227,7 @@ do sleep 1 done serial=`awk '$3 ~ /serial/ {print $1}' ns2/other.db` -newserial=`expr $serial + 1` +newserial=$((serial + 1)) sed s/$serial/$newserial/ ns2/other.db > ns2/other.db.new echo 'frozen TXT "frozen addition"' >> ns2/other.db.new mv -f ns2/other.db.new ns2/other.db @@ -249,9 +249,9 @@ grep 'addition 7' dig.out.2.test$n >/dev/null || ret=1 $DIGCMD frozen.other. TXT > dig.out.3.test$n grep 'frozen addition' dig.out.3.test$n >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "checking that journal is kept when ixfr-from-differences is in use ($n)" ret=0 $NSUPDATE -p ${PORT} -k ns2/session.key > nsupdate.out.1.test$n 2>&1 < ns2/nil.db.new echo 'frozen TXT "frozen addition"' >> ns2/nil.db.new mv -f ns2/nil.db.new ns2/nil.db @@ -292,32 +292,32 @@ grep 'addition 7' dig.out.2.test$n > /dev/null || ret=1 $DIGCMD frozen.nil. TXT > dig.out.3.test$n grep 'frozen addition' dig.out.3.test$n >/dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) # temp test echo_i "dumping stats ($n)" $RNDCCMD 10.53.0.2 stats -n=`expr $n + 1` +n=$((n+1)) echo_i "verifying adb records in named.stats ($n)" grep "ADB stats" ns2/named.stats > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test using second key ($n)" ret=0 $RNDC -s 10.53.0.2 -p ${CONTROLPORT} -c ns2/secondkey.conf status > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test 'rndc dumpdb' on a empty cache ($n)" ret=0 rndc_dumpdb ns3 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test 'rndc reload' on a zone with include files ($n)" ret=0 grep "incl/IN: skipping load" ns2/named.run > /dev/null && ret=1 @@ -344,9 +344,9 @@ do done [ $tmp -eq 1 ] && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-md5 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key1.conf status > /dev/null 2>&1 || ret=1 @@ -355,9 +355,9 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT1} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-sha1 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT2} -c ns4/key2.conf status > /dev/null 2>&1 || ret=1 @@ -366,9 +366,9 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT2} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-sha224 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT3} -c ns4/key3.conf status > /dev/null 2>&1 || ret=1 @@ -377,9 +377,9 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT3} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-sha256 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT4} -c ns4/key4.conf status > /dev/null 2>&1 || ret=1 @@ -388,9 +388,9 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT4} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-sha384 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT5} -c ns4/key5.conf status > /dev/null 2>&1 || ret=1 @@ -399,9 +399,9 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT5} -c ns4/key${i}.conf status > /dev/null 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with hmac-sha512 ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf status > /dev/null 2>&1 || ret=1 @@ -410,32 +410,32 @@ do $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key${i}.conf status > /dev/null 2>&1 2>&1 && ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing automatic zones are reported ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf status > rndc.out.1.test$n || ret=1 grep "number of zones: 200 (198 automatic)" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with null command ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with unknown control channel command ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf obviouslynotacommand >/dev/null 2>&1 && ret=1 # rndc: 'obviouslynotacommand' failed: unknown command if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with querylog command ($n)" ret=0 # first enable it with querylog on option @@ -460,10 +460,10 @@ grep "query logging is now off" ns4/named.run > /dev/null || ret=1 $DIG @10.53.0.4 -p ${PORT} -c ch -t txt foo9876.bind > /dev/null || ret=1 grep "query: foo9876.bind CH TXT.*(.*)$" ns4/named.run > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) RNDCCMD4="$RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf" -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc nta time limits ($n)" ret=0 $RNDCCMD4 nta -l 2h nta1.example > rndc.out.1.test$n 2>&1 @@ -475,9 +475,9 @@ grep "Negative trust anchor added" rndc.out.3.test$n > /dev/null || ret=1 $RNDCCMD4 nta -l 8d nta4.example > rndc.out.4.test$n 2>&1 grep "NTA lifetime cannot exceed one week" rndc.out.4.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc nta -class option ($n)" ret=0 nextpart ns4/named.run > /dev/null @@ -491,43 +491,43 @@ $RNDCCMD4 nta -c fake nta1.example > rndc.out.4.test$n 2>&1 nextpart ns4/named.run | grep "added NTA 'nta1.example'" > /dev/null && ret=1 grep 'unknown class' rndc.out.4.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) for i in 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 do - n=`expr $n + 1` + n=$((n+1)) echo_i "testing rndc buffer size limits (size=${i}) ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf testgen ${i} 2>&1 > rndc.out.$i.test$n || ret=1 actual_size=`$GENCHECK rndc.out.$i.test$n` if [ "$?" = "0" ]; then - expected_size=`expr $i + 1` + expected_size=$((i+1)) if [ $actual_size != $expected_size ]; then ret=1; fi else ret=1 fi if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` + status=$((status+ret)) done -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc -r (show result) ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf -r testgen 0 2>&1 > rndc.out.1.test$n || ret=1 grep "ISC_R_SUCCESS 0" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "testing rndc with a token containing a space ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf -r flush '"view with a space"' 2>&1 > rndc.out.1.test$n || ret=1 grep "not found" rndc.out.1.test$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test 'rndc reconfig' with a broken config ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig > /dev/null || ret=1 @@ -537,17 +537,17 @@ echo "error error error" >> ns4/named.conf $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig > rndc.out.1.test$n 2>&1 && ret=1 grep "rndc: 'reconfig' failed: unexpected token" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check rndc status reports failure ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf status > rndc.out.1.test$n 2>&1 || ret=1 grep "reload/reconfig failed" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "restore working config ($n)" ret=0 mv ns4/named.conf.save ns4/named.conf @@ -555,129 +555,120 @@ sleep 1 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf reconfig > /dev/null || ret=1 sleep 1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check 'rndc status' 'reload/reconfig failure' is cleared after successful reload/reconfig ($n)" ret=0 $RNDC -s 10.53.0.4 -p ${EXTRAPORT6} -c ns4/key6.conf status > rndc.out.1.test$n 2>&1 || ret=1 grep "reload/reconfig failed" rndc.out.1.test$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test read-only control channel access ($n)" ret=0 $RNDCCMD 10.53.0.5 status > rndc.out.1.test$n 2>&1 || ret=1 $RNDCCMD 10.53.0.5 nta -dump > rndc.out.2.test$n 2>&1 || ret=1 $RNDCCMD 10.53.0.5 reconfig > rndc.out.3.test$n 2>&1 && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test rndc status shows running on ($n)" ret=0 $RNDCCMD 10.53.0.5 status > rndc.out.1.test$n 2>&1 || ret=1 grep "^running on " rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "test 'rndc reconfig' with loading of a large zone ($n)" ret=0 -cur=`awk 'BEGIN {l=0} /^/ {l++} END { print l }' ns6/named.run` +nextpart ns6/named.run > /dev/null cp ns6/named.conf ns6/named.conf.save echo "zone \"huge.zone\" { type primary; file \"huge.zone.db\"; };" >> ns6/named.conf echo_i "reloading config" $RNDCCMD 10.53.0.6 reconfig > rndc.out.1.test$n 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) sleep 1 -n=`expr $n + 1` + +n=$((n+1)) echo_i "check if zone load was scheduled ($n)" -grep "scheduled loading new zones" ns6/named.run > /dev/null || ret=1 +wait_for_log_peek 20 "scheduled loading new zones" ns6/named.run || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check if query for the zone returns SERVFAIL ($n)" $DIG @10.53.0.6 -p ${PORT} -t soa huge.zone > dig.out.1.test$n grep "SERVFAIL" dig.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed (ignored)"; ret=0; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "wait for the zones to be loaded ($n)" -ret=1 -try=0 -while test $try -lt 180 -do - sleep 1 - sed -n "$cur,"'$p' < ns6/named.run | grep "any newly configured zones are now loaded" > /dev/null && { - ret=0 - break - } - try=`expr $try + 1` -done +wait_for_log_peek 60 "huge.zone/IN: loaded serial" ns6/named.run || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check if query for the zone returns NOERROR ($n)" $DIG @10.53.0.6 -p ${PORT} -t soa huge.zone > dig.out.1.test$n grep "NOERROR" dig.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "verify that the full command is logged ($n)" ret=0 $RNDCCMD 10.53.0.2 null with extra arguments > /dev/null 2>&1 grep "received control channel command 'null with extra arguments'" ns2/named.run > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) mv ns6/named.conf.save ns6/named.conf sleep 1 $RNDCCMD 10.53.0.6 reconfig > /dev/null || ret=1 sleep 1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check 'rndc \"\"' is handled ($n)" ret=0 $RNDCCMD 10.53.0.2 "" > rndc.out.1.test$n 2>&1 && ret=1 grep "rndc: '' failed: failure" rndc.out.1.test$n > /dev/null if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check rndc -4 -6 ($n)" ret=0 $RNDCCMD 10.53.0.2 -4 -6 status > rndc.out.1.test$n 2>&1 && ret=1 grep "only one of -4 and -6 allowed" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check rndc -4 with an IPv6 server address ($n)" ret=0 $RNDCCMD fd92:7065:b8e:ffff::2 -4 status > rndc.out.1.test$n 2>&1 && ret=1 grep "address family not supported" rndc.out.1.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check rndc nta reports adding to multiple views ($n)" ret=0 $RNDCCMD 10.53.0.3 nta test.com > rndc.out.test$n 2>&1 || ret=1 lines=`cat rndc.out.test$n | wc -l` [ ${lines:-0} -eq 2 ] || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) -n=`expr $n + 1` +n=$((n+1)) echo_i "check 'rndc retransfer' of primary error message ($n)" ret=0 $RNDCCMD 10.53.0.2 retransfer nil > rndc.out.test$n 2>&1 && ret=1 @@ -686,7 +677,7 @@ grep "retransfer: inappropriate zone type: primary" rndc.out.test$n > /dev/null lines=`cat rndc.out.test$n | wc -l` [ ${lines:-0} -eq 2 ] || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -status=`expr $status + $ret` +status=$((status+ret)) echo_i "exit status: $status" [ $status -eq 0 ] || exit 1