]> 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 (GitLab job 6713398) <nicki@isc.org>
Mon, 12 Jan 2026 10:53:23 +0000 (10:53 +0000)
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.

(cherry picked from commit 9b63187a99b00ffc272612247a2ce5eba84fb71b)

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 69a5a5b167600a182af05b14fd8b1b4e65a9cc3f..c688c5a9992e312a93595326100455e1620b5fe4 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))
@@ -1209,7 +1209,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))
@@ -1217,7 +1217,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))
@@ -1251,7 +1251,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))
@@ -1274,7 +1274,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))
@@ -1282,7 +1282,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))
@@ -1291,7 +1291,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