Commit 4a8b3a8a authored by Michał Kępień's avatar Michał Kępień
Browse files

Use rndc_dumpdb() in the "sfcache" system test

parent 52beeed4
Pipeline #19311 passed with stages
in 13 minutes and 46 seconds
......@@ -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*
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment