]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add ans6 blackhole server to notify system test
authorMichal Nowak <mnowak@isc.org>
Tue, 9 Dec 2025 11:47:06 +0000 (12:47 +0100)
committerMichal Nowak <mnowak@isc.org>
Thu, 11 Dec 2025 15:21:11 +0000 (16:21 +0100)
On AlmaLinux 9 with Python 3.9, ans6 fails after TCP connection is
accepted but reading is blocked. See the block_reading() comment of the
asynserver, that this hack may not be universal, and do not run this
test on Enterprise Linux 9 with Python 3.9.

    2025-12-11 10:22:44,348    DEBUG  Accepted TCP connection from 10.53.0.3:38821
    2025-12-11 10:22:44,348     INFO  Blocking reads from 10.53.0.3:38821
    2025-12-11 10:22:44,348    DEBUG  Receiving TCP message length from 10.53.0.3:38821...
    2025-12-11 10:22:44,348    DEBUG  Received 1 TCP octets from 10.53.0.3:38821
    2025-12-11 10:22:45,144    DEBUG  Received UDP message: ae6c24000001000100000000076578616d706c650000060001c00c0006000100000000001d066d6e616d65310000000000040000012c0000012c001baf8000000e10
    2025-12-11 10:22:45,145     INFO  Received example/IN/SOA (ID=44652) query from 10.53.0.3:52759 (UDP)
    2025-12-11 10:22:45,145    DEBUG  [IN]
    [IN] id 44652
    [IN] opcode NOTIFY
    [IN] rcode NOERROR
    [IN] flags AA
    [IN] ;QUESTION
    [IN] example. IN SOA
    [IN] ;ANSWER
    [IN] example. 0 IN SOA mname1. . 4 300 300 1814400 3600
    [IN] ;AUTHORITY
    [IN] ;ADDITIONAL
    2025-12-11 10:22:45,145    DEBUG  Matched response handler: IgnoreAllQueries
    2025-12-11 10:22:45,145     INFO  Not sending a response to query (ID=44652) from 10.53.0.3:52759 (UDP)
    Traceback (most recent call last):
      File "/builds/isc-projects/bind9/bin/tests/system/notify_tmp_uja_xk9f/ans6/ans.py", line 27, in <module>
        main()
      File "/builds/isc-projects/bind9/bin/tests/system/notify_tmp_uja_xk9f/ans6/ans.py", line 23, in main
        server.run()
      File "/builds/isc-projects/bind9/bin/tests/system/isctest/asyncserver.py", line 170, in run
        asyncio.run(coroutine())
      File "/usr/lib64/python3.9/asyncio/runners.py", line 44, in run
        return loop.run_until_complete(main)
      File "/usr/lib64/python3.9/asyncio/base_events.py", line 647, in run_until_complete
        return future.result()
      File "/builds/isc-projects/bind9/bin/tests/system/isctest/asyncserver.py", line 183, in _run
        await self._work_done
    RuntimeError: Task was destroyed but it is pending!

bin/tests/system/notify/ans6/ans.py [new file with mode: 0644]
bin/tests/system/notify/ns3/named.conf.j2
bin/tests/system/notify/tests.sh
bin/tests/system/notify/tests_sh_notify.py

diff --git a/bin/tests/system/notify/ans6/ans.py b/bin/tests/system/notify/ans6/ans.py
new file mode 100644 (file)
index 0000000..ab066c4
--- /dev/null
@@ -0,0 +1,27 @@
+# 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 isctest.asyncserver import (
+    AsyncDnsServer,
+    IgnoreAllConnections,
+    IgnoreAllQueries,
+)
+
+
+def main() -> None:
+    server = AsyncDnsServer()
+    server.install_connection_handler(IgnoreAllConnections())
+    server.install_response_handler(IgnoreAllQueries())
+    server.run()
+
+
+if __name__ == "__main__":
+    main()
index 756ec746fc474b9695cc0b0a8b29d8629054e291..2e9ea660714ad8934d554efe21459d7f82597cd8 100644 (file)
@@ -45,7 +45,7 @@ zone "example" {
        primaries { 10.53.0.2; };
        file "example.bk";
        # non-responsive notify recipient (no reply, no ICMP errors)
-       also-notify { 10.53.10.53; };
+       also-notify { 10.53.0.6; };
 };
 
 zone "notify-source-port-test" {
index 30c3d3e73625909301e763ceb2b8b7283d0dbe53..05a9aa828096844aa4c221768a0361a654a5a2aa 100644 (file)
@@ -222,7 +222,7 @@ grep "sending notify to 10.53.0.5#[0-9]* : TSIG (b)" ns5/named.run >/dev/null ||
 grep "sending notify to 10.53.0.5#[0-9]* : TSIG (c)" ns5/named.run >/dev/null || ret=1
 test_end
 
-# notify messages were sent to unresponsive 10.53.10.53 during the tests
+# notify messages were sent to unresponsive 10.53.0.6 during the tests
 # above, which should time out at some point; we need to wait for them to
 # appear in the logs in case the tests run faster than the notify timeouts
 
index 74c626b76b95f7cf8909fc937926399562c66eff..768493e8785bc37325b9b480d1434840a32d4ceb 100644 (file)
@@ -9,27 +9,51 @@
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
+import sys
+
+from pathlib import Path
+
 import pytest
 
-pytestmark = pytest.mark.extra_artifacts(
-    [
-        "awk.out.*",
-        "dig.out.*",
-        "ns2/example.db",
-        "ns2/named-tls.conf",
-        "ns2/x21.db*",
-        "ns3/example.bk",
-        "ns3/named-tls.conf",
-        "ns4/named.port",
-        "ns4/x21.bk",
-        "ns4/x21.bk.jnl",
-        "ns5/x21.bk-b",
-        "ns5/x21.bk-b.jnl",
-        "ns5/x21.bk-c",
-        "ns5/x21.bk-c.jnl",
-        "ns5/x21.db.jnl",
-    ]
-)
+# isctest.asyncserver requires dnspython >= 2.0.0
+pytest.importorskip("dns", minversion="2.0.0")
+
+
+def is_el9_with_python_39():
+    if sys.version_info[:2] > (3, 9):
+        return False
+    return 'PLATFORM_ID="platform:el9"' in Path("/etc/os-release").read_text(
+        encoding="utf-8"
+    )
+
+
+pytestmark = [
+    # ans6 fails on TCP query arrival on EL9 with Python 3.9
+    pytest.mark.skipif(
+        is_el9_with_python_39(),
+        reason="On Enterprise Linux 9, Python > 3.9 is required",
+    ),
+    pytest.mark.extra_artifacts(
+        [
+            "awk.out.*",
+            "dig.out.*",
+            "ns2/example.db",
+            "ns2/named-tls.conf",
+            "ns2/x21.db*",
+            "ns3/example.bk",
+            "ns3/named-tls.conf",
+            "ns4/named.port",
+            "ns4/x21.bk",
+            "ns4/x21.bk.jnl",
+            "ns5/x21.bk-b",
+            "ns5/x21.bk-b.jnl",
+            "ns5/x21.bk-c",
+            "ns5/x21.bk-c.jnl",
+            "ns5/x21.db.jnl",
+            "ans6/ans.run",
+        ]
+    ),
+]
 
 
 def test_notify(run_tests_sh):