From: Štěpán Balážik Date: Wed, 18 Jun 2025 19:06:19 +0000 (+0200) Subject: Add a system test that ensures root zone mirroring works out of the box X-Git-Tag: v9.20.11~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97caa0addcebbb1b48b229bad5b8de61f03d09bf;p=thirdparty%2Fbind9.git Add a system test that ensures root zone mirroring works out of the box This is a test for #5380. (cherry picked from commit a69efc678c1e0ee282002ea7afbf93dc104f54ae) --- diff --git a/bin/tests/system/mirror/ns4/named.conf.j2 b/bin/tests/system/mirror/ns4/named.conf.j2 new file mode 100644 index 00000000000..4d83d120f1f --- /dev/null +++ b/bin/tests/system/mirror/ns4/named.conf.j2 @@ -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 index 00000000000..98bbdc91942 --- /dev/null +++ b/bin/tests/system/mirror/tests_mirror.py @@ -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")