From f520e571b43cd90eaca13e8a37d8104bcc94503f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 8 Aug 2019 14:27:55 +0200 Subject: [PATCH] Use rndc_dumpdb() in the "serve-stale" system test (cherry picked from commit 52beeed4442e81b6e1268ee7c001a00e52a3b37d) --- bin/tests/system/serve-stale/ns1/named1.conf.in | 1 - bin/tests/system/serve-stale/ns1/named2.conf.in | 1 - bin/tests/system/serve-stale/tests.sh | 10 +++------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bin/tests/system/serve-stale/ns1/named1.conf.in b/bin/tests/system/serve-stale/ns1/named1.conf.in index 5e7caec3fe..be3551aae9 100644 --- a/bin/tests/system/serve-stale/ns1/named1.conf.in +++ b/bin/tests/system/serve-stale/ns1/named1.conf.in @@ -27,7 +27,6 @@ options { listen-on { 10.53.0.1; }; listen-on-v6 { none; }; recursion yes; - dump-file "named_dump1.db"; max-stale-ttl 3600; stale-answer-ttl 2; stale-answer-enable yes; diff --git a/bin/tests/system/serve-stale/ns1/named2.conf.in b/bin/tests/system/serve-stale/ns1/named2.conf.in index f330fd45cf..cdf1e9445d 100644 --- a/bin/tests/system/serve-stale/ns1/named2.conf.in +++ b/bin/tests/system/serve-stale/ns1/named2.conf.in @@ -26,7 +26,6 @@ options { pid-file "named.pid"; listen-on { 10.53.0.1; }; listen-on-v6 { none; }; - dump-file "named_dump1.db"; recursion yes; max-stale-ttl 7200; stale-answer-ttl 3; diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh index a74b39efe0..01d3f210b6 100755 --- a/bin/tests/system/serve-stale/tests.sh +++ b/bin/tests/system/serve-stale/tests.sh @@ -96,15 +96,11 @@ grep "data\.example\..*2.*IN.*TXT.*A text record with a 1 second ttl" dig.out.te # Run rndc dumpdb, test whether the stale data has correct comment printed. # The max-stale-ttl is 3600 seconds, so the comment should say the data is # stale for somewhere between 3500-3599 seconds. -$RNDCCMD 10.53.0.1 dumpdb > rndc.out.test$n 2>&1 || ret=1 -for i in 0 1 2 3 4 5 6 7 8 9; do - grep '^; Dump complete$' ns1/named_dump1.db > /dev/null 2>&1 && break - sleep 1 -done -awk '/; stale/ { x=$0; getline; print x, $0}' ns1/named_dump1.db | +rndc_dumpdb ns1 || ret=1 +awk '/; stale/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n | grep "; stale (will be retained for 35.. more seconds) data\.example.*A text record with a 1 second ttl" > /dev/null 2>&1 || ret=1 # Also make sure the not expired data does not have a stale comment. -awk '/; answer/ { x=$0; getline; print x, $0}' ns1/named_dump1.db | +awk '/; answer/ { x=$0; getline; print x, $0}' ns1/named_dump.db.test$n | grep "; answer longttl\.example.*A text record with a 600 second ttl" > /dev/null 2>&1 || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret`