]> 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:48:02 +0000 (19:48 +1100)
(cherry picked from commit c38752b07ce8256488b7c31ec1175ac5c926e456)

bin/tests/system/rpz/tests.sh

index 255779f785a82986d71361582a050c0bca8c6fb0..4f683c98dc90ec27fc4efd0a3f4922f8310daccb 100644 (file)
@@ -432,6 +432,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
@@ -470,8 +488,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