]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
spin waiting for prototype dig responses
authorMark Andrews <marka@isc.org>
Wed, 12 Feb 2020 02:54:17 +0000 (13:54 +1100)
committerMark Andrews <marka@isc.org>
Wed, 12 Feb 2020 08:12:02 +0000 (08:12 +0000)
bin/tests/system/rpz/tests.sh

index 88f74d0576bc99f494776f997f6566719cab2f62..8939483dfd06f1ae13e500f5cd53a5246ea2ba55 100644 (file)
@@ -433,6 +433,24 @@ EOF
   sleep 2
 }
 
+#
+# generate prototype NXDOMAIN response to compare against.
+#
+make_proto_nxdomain() {
+  digcmd nonexistent @$ns2 >proto.nxdomain || return 1
+  grep "status: NXDOMAIN" proto.nxdomain >/dev/null || return 1
+  return 0
+}
+
+#
+# generate prototype NODATA response to compare against.
+#
+make_proto_nodata() {
+  digcmd txt-only.tld2 @$ns2 >proto.nodata || return 1
+  grep "status: NOERROR" proto.nodata >/dev/null || return 1
+  return 0
+}
+
 for mode in native dnsrps; do
   status=0
   case ${mode} in
@@ -472,8 +490,8 @@ for mode in native dnsrps; do
   esac
 
   # make prototype files to check against rewritten results
-  digcmd nonexistent @$ns2 >proto.nxdomain
-  digcmd txt-only.tld2 @$ns2 >proto.nodata
+  retry_quiet 10 make_proto_nxdomain
+  retry_quiet 10 make_proto_nodata
 
   start_group "QNAME rewrites" test1
   nochange .                                   # 1 do not crash or rewrite root