]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait until "rndc dumpdb" completes
authorMichał Kępień <michal@isc.org>
Wed, 20 Mar 2019 07:46:58 +0000 (08:46 +0100)
committerMichał Kępień <michal@isc.org>
Wed, 20 Mar 2019 07:48:25 +0000 (08:48 +0100)
"rndc dumpdb" works asynchronously, i.e. the requested dump may not yet
be fully written to disk by the time "rndc" returns.  Prevent false
positives for the "serve-stale" system test by only checking dump
contents after the line indicating that it is complete is written.

(cherry picked from commit 6e3f812afc876f4813aedda32340984b6bf5c9b3)

bin/tests/system/serve-stale/tests.sh

index fa7719089ce66279c1e3d3d1032cd8817caaf85b..a74b39efe0b45cf6c8fd3112058a9d2bdb4c17d5 100755 (executable)
@@ -97,6 +97,10 @@ grep "data\.example\..*2.*IN.*TXT.*A text record with a 1 second ttl" dig.out.te
 # 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 |
     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.