]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Renumber ans7->ans6 and ans8->ans7 in digdelv test
authorNicki Křížek <nicki@isc.org>
Wed, 7 Jan 2026 15:31:37 +0000 (16:31 +0100)
committerNicki Křížek <nicki@isc.org>
Mon, 12 Jan 2026 10:09:14 +0000 (11:09 +0100)
Since there was no 10.53.0.6 server in the test, renumber the remaining
ones so that there's no gap in the server names.

This commit simply moves the ans.py files without any changes and
renumbers the IP addresses in tests.

bin/tests/system/digdelv/ans6/ans.py [new file with mode: 0644]
bin/tests/system/digdelv/ans7/ans.py
bin/tests/system/digdelv/ans8/ans.py [deleted file]
bin/tests/system/digdelv/tests.sh

diff --git a/bin/tests/system/digdelv/ans6/ans.py b/bin/tests/system/digdelv/ans6/ans.py
new file mode 100644 (file)
index 0000000..77e7141
--- /dev/null
@@ -0,0 +1,40 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+from typing import AsyncGenerator
+
+import dns.opcode
+import dns.rcode
+
+from isctest.asyncserver import (
+    AsyncDnsServer,
+    DnsResponseSend,
+    ResponseHandler,
+    QueryContext,
+)
+
+
+class ReplyUpdateHandler(ResponseHandler):
+    async def get_responses(
+        self, qctx: QueryContext
+    ) -> AsyncGenerator[DnsResponseSend, None]:
+        qctx.response.set_opcode(dns.opcode.UPDATE)
+        yield DnsResponseSend(qctx.response)
+
+
+def main() -> None:
+    server = AsyncDnsServer(default_aa=True, default_rcode=dns.rcode.NOERROR)
+    server.install_response_handler(ReplyUpdateHandler())
+    server.run()
+
+
+if __name__ == "__main__":
+    main()
index 77e7141590704d272411b5fb0f8289ed30ce90a3..d959b597e23eb451b13989efe315a433ee9b15ed 100644 (file)
 
 from typing import AsyncGenerator
 
-import dns.opcode
+import dns
 import dns.rcode
 
 from isctest.asyncserver import (
     AsyncDnsServer,
+    CloseConnection,
     DnsResponseSend,
-    ResponseHandler,
+    DomainHandler,
+    IgnoreAllQueries,
     QueryContext,
+    ResponseAction,
+    ResponseDrop,
 )
 
 
-class ReplyUpdateHandler(ResponseHandler):
+class SilentHandler(DomainHandler, IgnoreAllQueries):
+    """Handler that doesn't respond."""
+
+    domains = ["silent.example"]
+
+
+class CloseHandler(DomainHandler):
+    """Handler that doesn't respond and closes TCP connection."""
+
+    domains = ["close.example"]
+
+    async def get_responses(
+        self, qctx: QueryContext
+    ) -> AsyncGenerator[ResponseAction, None]:
+        yield CloseConnection()
+
+
+class SilentThenServfailHandler(DomainHandler):
+    """Handler that drops one query and response to the next one with SERVFAIL."""
+
+    domains = ["silent-then-servfail.example"]
+    counter = 0
+
     async def get_responses(
         self, qctx: QueryContext
-    ) -> AsyncGenerator[DnsResponseSend, None]:
-        qctx.response.set_opcode(dns.opcode.UPDATE)
-        yield DnsResponseSend(qctx.response)
+    ) -> AsyncGenerator[ResponseAction, None]:
+        if self.counter % 2 == 0:
+            yield ResponseDrop()
+        else:
+            qctx.response.set_rcode(dns.rcode.SERVFAIL)
+            yield DnsResponseSend(qctx.response, authoritative=False)
+        self.counter += 1
 
 
 def main() -> None:
-    server = AsyncDnsServer(default_aa=True, default_rcode=dns.rcode.NOERROR)
-    server.install_response_handler(ReplyUpdateHandler())
+    server = AsyncDnsServer()
+    server.install_response_handlers(
+        [
+            CloseHandler(),
+            SilentHandler(),
+            SilentThenServfailHandler(),
+        ]
+    )
     server.run()
 
 
diff --git a/bin/tests/system/digdelv/ans8/ans.py b/bin/tests/system/digdelv/ans8/ans.py
deleted file mode 100644 (file)
index d959b59..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# SPDX-License-Identifier: MPL-2.0
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0.  If a copy of the MPL was not distributed with this
-# file, you can obtain one at https://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-from typing import AsyncGenerator
-
-import dns
-import dns.rcode
-
-from isctest.asyncserver import (
-    AsyncDnsServer,
-    CloseConnection,
-    DnsResponseSend,
-    DomainHandler,
-    IgnoreAllQueries,
-    QueryContext,
-    ResponseAction,
-    ResponseDrop,
-)
-
-
-class SilentHandler(DomainHandler, IgnoreAllQueries):
-    """Handler that doesn't respond."""
-
-    domains = ["silent.example"]
-
-
-class CloseHandler(DomainHandler):
-    """Handler that doesn't respond and closes TCP connection."""
-
-    domains = ["close.example"]
-
-    async def get_responses(
-        self, qctx: QueryContext
-    ) -> AsyncGenerator[ResponseAction, None]:
-        yield CloseConnection()
-
-
-class SilentThenServfailHandler(DomainHandler):
-    """Handler that drops one query and response to the next one with SERVFAIL."""
-
-    domains = ["silent-then-servfail.example"]
-    counter = 0
-
-    async def get_responses(
-        self, qctx: QueryContext
-    ) -> AsyncGenerator[ResponseAction, None]:
-        if self.counter % 2 == 0:
-            yield ResponseDrop()
-        else:
-            qctx.response.set_rcode(dns.rcode.SERVFAIL)
-            yield DnsResponseSend(qctx.response, authoritative=False)
-        self.counter += 1
-
-
-def main() -> None:
-    server = AsyncDnsServer()
-    server.install_response_handlers(
-        [
-            CloseHandler(),
-            SilentHandler(),
-            SilentThenServfailHandler(),
-        ]
-    )
-    server.run()
-
-
-if __name__ == "__main__":
-    main()
index c07ed392c095a747cc4de3c6d3368345ce48dd28..31360dd34243fc03129520e23e8af9ec7bd542fb 100644 (file)
@@ -76,7 +76,7 @@ $PYTHON -c "import yaml" 2>/dev/null && HAS_PYYAML=1
 n=$((n + 1))
 echo_i "check nslookup handles UPDATE response ($n)"
 ret=0
-"$NSLOOKUP" -q=CNAME -timeout=1 "-port=$PORT" foo.bar 10.53.0.7 >nslookup.out.test$n 2>&1 && ret=1
+"$NSLOOKUP" -q=CNAME -timeout=1 "-port=$PORT" foo.bar 10.53.0.6 >nslookup.out.test$n 2>&1 && ret=1
 grep "Opcode mismatch" nslookup.out.test$n >/dev/null || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
@@ -84,7 +84,7 @@ status=$((status + ret))
 n=$((n + 1))
 echo_i "check host handles UPDATE response ($n)"
 ret=0
-"$HOST" -W 1 -t CNAME -p $PORT foo.bar 10.53.0.7 >host.out.test$n 2>&1 && ret=1
+"$HOST" -W 1 -t CNAME -p $PORT foo.bar 10.53.0.6 >host.out.test$n 2>&1 && ret=1
 grep "Opcode mismatch" host.out.test$n >/dev/null || ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status + ret))
@@ -94,7 +94,7 @@ echo_i "check nsupdate handles UPDATE response to QUERY ($n)"
 ret=0
 res=0
 $NSUPDATE <<EOF >nsupdate.out.test$n 2>&1 || res=$?
-server 10.53.0.7 ${PORT}
+server 10.53.0.6 ${PORT}
 add x.example.com 300 in a 1.2.3.4
 send
 EOF
@@ -107,7 +107,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check dig handles UPDATE response ($n)"
   ret=0
-  dig_with_opts @10.53.0.7 +tries=1 +timeout=1 cname foo.bar >dig.out.test$n 2>&1 && ret=1
+  dig_with_opts @10.53.0.6 +tries=1 +timeout=1 cname foo.bar >dig.out.test$n 2>&1 && ret=1
   grep "Opcode mismatch" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1276,7 +1276,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig handles UDP timeout followed by a SERVFAIL correctly ($n)"
   ret=0
-  dig_with_opts +timeout=1 +nofail @10.53.0.8 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts +timeout=1 +nofail @10.53.0.7 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1
   grep -F "status: SERVFAIL" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1284,7 +1284,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig handles TCP timeout followed by a SERVFAIL correctly ($n)"
   ret=0
-  dig_with_opts +timeout=1 +nofail +tcp @10.53.0.8 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts +timeout=1 +nofail +tcp @10.53.0.7 silent-then-servfail.example >dig.out.test$n 2>&1 || ret=1
   grep -F "status: SERVFAIL" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1318,7 +1318,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig tries the next server after a TCP socket read error ($n)"
   ret=0
-  dig_with_opts +tcp @10.53.0.8 @10.53.0.3 close.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts +tcp @10.53.0.7 @10.53.0.3 close.example >dig.out.test$n 2>&1 || ret=1
   grep -F "status: NOERROR" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1341,7 +1341,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig tries the next server after UDP socket read timeouts ($n)"
   ret=0
-  dig_with_opts +timeout=1 @10.53.0.8 @10.53.0.3 silent.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts +timeout=1 @10.53.0.7 @10.53.0.3 silent.example >dig.out.test$n 2>&1 || ret=1
   grep -F "status: NOERROR" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1349,7 +1349,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig tries the next server after TCP socket read timeouts ($n)"
   ret=0
-  dig_with_opts +timeout=1 +tcp @10.53.0.8 @10.53.0.3 silent.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts +timeout=1 +tcp @10.53.0.7 @10.53.0.3 silent.example >dig.out.test$n 2>&1 || ret=1
   grep -F "status: NOERROR" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
@@ -1358,7 +1358,7 @@ if [ -x "$DIG" ]; then
   n=$((n + 1))
   echo_i "check that dig correctly refuses to use a server with a IPv4 mapped IPv6 address after failing with a regular IP address ($n)"
   ret=0
-  dig_with_opts @10.53.0.8 @::ffff:10.53.0.8 silent.example >dig.out.test$n 2>&1 || ret=1
+  dig_with_opts @10.53.0.7 @::ffff:10.53.0.7 silent.example >dig.out.test$n 2>&1 || ret=1
   grep -F ";; Skipping mapped address" dig.out.test$n >/dev/null || ret=1
   grep -F ";; No acceptable nameservers" dig.out.test$n >/dev/null || ret=1
   if [ $ret -ne 0 ]; then echo_i "failed"; fi