]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Assign an index to each check in the cacheclean system test
authorMichał Kępień <michal@isc.org>
Tue, 20 Feb 2018 12:59:25 +0000 (13:59 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 20 Feb 2018 12:59:25 +0000 (13:59 +0100)
This will enable storing per-check forensic data, which facilitates
troubleshooting test failures.

bin/tests/system/cacheclean/tests.sh

index 2c6f2ccac21f746e15b2cd3af3b26843932ef464..28414ade3bc593388a26c99009b4cccfce125e00 100644 (file)
@@ -12,6 +12,7 @@ SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
 
 status=0
+n=0
 
 RNDCOPTS="-c ../common/rndc.conf -s 10.53.0.2 -p 9953"
 DIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm \
@@ -75,18 +76,21 @@ in_cache () {
         return 0
 }
 
-echo "I:check correctness of routine cache cleaning"
+n=`expr $n + 1`
+echo "I:check correctness of routine cache cleaning ($n)"
 $DIG $DIGOPTS +tcp +keepopen -b 10.53.0.7 -f dig.batch > dig.out.ns2 || status=1
 grep ";" dig.out.ns2
 
 $PERL ../digcomp.pl --lc dig.out.ns2 knowngood.dig.out || status=1
 
-echo "I:only one tcp socket was used"
+n=`expr $n + 1`
+echo "I:only one tcp socket was used ($n)"
 tcpclients=`awk '$3 == "client" && $5 ~ /10.53.0.7#[0-9]*:/ {print $5}' ns2/named.run | sort | uniq -c | wc -l`
 
 test $tcpclients -eq 1 || { status=1; echo "I:failed"; }
 
-echo "I:reset and check that records are correctly cached initially"
+n=`expr $n + 1`
+echo "I:reset and check that records are correctly cached initially ($n)"
 ret=0
 load_cache
 dump_cache
@@ -95,7 +99,8 @@ nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | egrep '(TXT|
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing of the full cache"
+n=`expr $n + 1`
+echo "I:check flushing of the full cache ($n)"
 ret=0
 clear_cache
 dump_cache
@@ -104,7 +109,8 @@ nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | wc -l`
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing of individual nodes (interior node)"
+n=`expr $n + 1`
+echo "I:check flushing of individual nodes (interior node) ($n)"
 ret=0
 clear_cache
 load_cache
@@ -115,7 +121,8 @@ in_cache txt top1.flushtest.example && ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing of individual nodes (leaf node, under the interior node)"
+n=`expr $n + 1`
+echo "I:check flushing of individual nodes (leaf node, under the interior node) ($n)"
 ret=0
 # leaf node, under the interior node (should still exist)
 in_cache txt third2.second1.top1.flushtest.example || ret=1
@@ -124,7 +131,8 @@ in_cache txt third2.second1.top1.flushtest.example && ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing of individual nodes (another leaf node, with both positive and negative cache entries)"
+n=`expr $n + 1`
+echo "I:check flushing of individual nodes (another leaf node, with both positive and negative cache entries) ($n)"
 ret=0
 # another leaf node, with both positive and negative cache entries
 in_cache a third1.second1.top1.flushtest.example || ret=1
@@ -135,13 +143,15 @@ in_cache txt third1.second1.top1.flushtest.example && ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing a nonexistent name"
+n=`expr $n + 1`
+echo "I:check flushing a nonexistent name ($n)"
 ret=0
 $RNDC $RNDCOPTS flushname fake.flushtest.example || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing of namespaces"
+n=`expr $n + 1`
+echo "I:check flushing of namespaces ($n)"
 ret=0
 clear_cache
 load_cache
@@ -167,13 +177,15 @@ in_cache txt second3.top2.flushtest.example && ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushing a nonexistent namespace"
+n=`expr $n + 1`
+echo "I:check flushing a nonexistent namespace ($n)"
 ret=0
 $RNDC $RNDCOPTS flushtree fake.flushtest.example || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check the number of cached records remaining"
+n=`expr $n + 1`
+echo "I:check the number of cached records remaining ($n)"
 ret=0
 dump_cache
 nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | egrep '(TXT|ANY)' |  wc -l`
@@ -181,7 +193,8 @@ nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | egrep '(TXT|
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check the check that flushname of a partial match works."
+n=`expr $n + 1`
+echo "I:check the check that flushname of a partial match works ($n)"
 ret=0
 in_cache txt second2.top1.flushtest.example || ret=1
 $RNDC $RNDCOPTS flushtree example
@@ -189,7 +202,8 @@ in_cache txt second2.top1.flushtest.example && ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check the number of cached records remaining"
+n=`expr $n + 1`
+echo "I:check the number of cached records remaining ($n)"
 ret=0
 dump_cache
 nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | egrep '(TXT|ANY)' |  wc -l`
@@ -197,7 +211,8 @@ nrecords=`grep flushtest.example ns2/named_dump.db | grep -v '^;' | egrep '(TXT|
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check flushtree clears adb correctly"
+n=`expr $n + 1`
+echo "I:check flushtree clears adb correctly ($n)"
 ret=0
 load_cache
 dump_cache
@@ -208,14 +223,16 @@ awk '/plain success\/timeout/ {getline; getline; if ($2 == "ns.flushtest.example
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check expire option returned from master zone"
+n=`expr $n + 1`
+echo "I:check expire option returned from master zone ($n)"
 ret=0
 $DIG @10.53.0.1 -p 5300 +expire soa expire-test > dig.out.expire
 grep EXPIRE: dig.out.expire > /dev/null || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
-echo "I:check expire option returned from slave zone"
+n=`expr $n + 1`
+echo "I:check expire option returned from slave zone ($n)"
 ret=0
 $DIG @10.53.0.2 -p 5300 +expire soa expire-test > dig.out.expire
 grep EXPIRE: dig.out.expire > /dev/null || ret=1