]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use rndc_dumpdb() in the "sfcache" system test
authorMichał Kępień <michal@isc.org>
Thu, 8 Aug 2019 12:27:55 +0000 (14:27 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 8 Aug 2019 12:27:55 +0000 (14:27 +0200)
bin/tests/system/sfcache/clean.sh
bin/tests/system/sfcache/tests.sh

index 51939e98b04d6bfc50a7f2e35f6ea3b483842c31..75e55c18d8161efda603baabbcce9d3ddb07de5c 100644 (file)
@@ -17,7 +17,9 @@ rm -f ./*/named.memstats
 rm -f ./*/named.conf
 rm -f ./*/named.run ./*/named.run.prev
 rm -f ./dig.*
+rm -f ./rndc.*
 rm -f ./sfcache.*
+rm -f ./ns*/managed-keys.bind*
 rm -f ./ns*/named.lock
 rm -f ./ns5/named.run.part*
-rm -f ./ns*/managed-keys.bind*
+rm -f ./ns5/named_dump*
index 19e34a724e40a506014701fe1ed5e11a6cf42ea5..c512d6eea69b3bde19fd78e6b96aedf55007bfde 100644 (file)
@@ -31,13 +31,8 @@ rndc_with_opts() {
 echo_i "checking DNSSEC SERVFAIL is cached ($n)"
 ret=0
 dig_with_opts +dnssec foo.example. a @10.53.0.5 > dig.out.ns5.test$n || ret=1
-rndc_with_opts 10.53.0.5 dumpdb -all 2>&1 | sed 's/^/I:ns5 /'
-# shellcheck disable=SC2034
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
-    [ -s "sfcache.$n" ] && break
-    sleep 1
-done
+rndc_dumpdb ns5 -all
+awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db.test$n > sfcache.$n
 grep "^; foo.example/A" sfcache.$n > /dev/null || ret=1
 n=$((n+1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -62,17 +57,16 @@ status=$((status+ret))
 echo_i "switching to non-dnssec SERVFAIL tests"
 ret=0
 rndc_with_opts 10.53.0.5 flush 2>&1 | sed 's/^/I:ns5 /'
-rndc_with_opts 10.53.0.5 dumpdb -all 2>&1 | sed 's/^/I:ns5 /'
-awk '/SERVFAIL/ { next; out=1 } /Zone/ { out=0 } { if (out) print }' ns5/named_dump.db
+rndc_dumpdb ns5 -all
+mv ns5/named_dump.db.test$n ns5/named_dump.db.test$n.1
+awk '/SERVFAIL/ { next; out=1 } /Zone/ { out=0 } { if (out) print }' ns5/named_dump.db.test$n.1 > sfcache.$n.1
+[ -s "sfcache.$n.1" ] && ret=1
 echo_i "checking SERVFAIL is cached ($n)"
 dig_with_opts bar.example2. a @10.53.0.5 > dig.out.ns5.test$n || ret=1
-for i in 1 2 3 4 5 6 7 8 9 10; do
-    rndc_with_opts 10.53.0.5 dumpdb -all 2>&1 | sed 's/^/I:ns5 /'
-    sleep 1
-    awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db > sfcache.$n
-    [ -s "sfcache.$n" ] && break
-done
-grep "^; bar.example2/A" sfcache.$n > /dev/null || ret=1
+rndc_dumpdb ns5 -all
+mv ns5/named_dump.db.test$n ns5/named_dump.db.test$n.2
+awk '/Zone/{out=0} { if (out) print } /SERVFAIL/{out=1}' ns5/named_dump.db.test$n.2 > sfcache.$n.2
+grep "^; bar.example2/A" sfcache.$n.2 > /dev/null || ret=1
 n=$((n+1))
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))