]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a system test that ensures root zone mirroring works out of the box
authorŠtěpán Balážik <stepan@isc.org>
Wed, 18 Jun 2025 19:06:19 +0000 (21:06 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Fri, 27 Jun 2025 12:10:40 +0000 (12:10 +0000)
This is a test for #5380.

(cherry picked from commit a69efc678c1e0ee282002ea7afbf93dc104f54ae)

bin/tests/system/mirror/ns4/named.conf.j2 [new file with mode: 0644]
bin/tests/system/mirror/tests_mirror.py [new file with mode: 0644]

diff --git a/bin/tests/system/mirror/ns4/named.conf.j2 b/bin/tests/system/mirror/ns4/named.conf.j2
new file mode 100644 (file)
index 0000000..4d83d12
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+key rndc_key {
+       secret "1234abcd8765";
+       algorithm @DEFAULT_HMAC@;
+};
+
+controls {
+       inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+options {
+       pid-file "named.pid";
+       listen-on port @PORT@ {10.53.0.4;};
+};
+
+zone "." { type mirror; };
diff --git a/bin/tests/system/mirror/tests_mirror.py b/bin/tests/system/mirror/tests_mirror.py
new file mode 100644 (file)
index 0000000..98bbdc9
--- /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 typing import Dict
+
+from isctest.instance import NamedInstance
+from isctest.mark import live_internet_test
+
+
+@live_internet_test
+def test_mirror_root_zone(servers: Dict[str, NamedInstance]):
+    """
+    This test pulls the root zone from the Internet, so let's only run
+    it when CI_ENABLE_LIVE_INTERNET_TESTS is set.
+    """
+    ns4 = servers["ns4"]
+    with ns4.watch_log_from_start() as watch_log:
+        # TimeoutError is raised if the line is not found and the test will fail.
+        watch_log.wait_for_line("Transfer status: success")