From c7a8f6105578c43f6d1d1a60e54d5c84ad7470a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Fri, 20 Jun 2025 14:09:17 +0200 Subject: [PATCH 1/3] Rename CI_ENABLE_ALL_TESTS to CI_ENABLE_LONG_TESTS New name is more descriptive and allows us to created more optional test sets. --- .gitlab-ci.yml | 4 ++-- bin/tests/system/isctest/mark.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca6d4661f2..0df0e483ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -912,7 +912,7 @@ system:gcc:bookworm:amd64: <<: *debian_bookworm_amd64_image <<: *system_test_job variables: - CI_ENABLE_ALL_TESTS: 1 + CI_ENABLE_LONG_TESTS: 1 CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0 TZ: Australia/Sydney needs: # using artifacts from unit test job is required for gcov @@ -923,7 +923,7 @@ unit:gcc:bookworm:amd64: <<: *debian_bookworm_amd64_image <<: *unit_test_job variables: - CI_ENABLE_ALL_TESTS: 1 + CI_ENABLE_LONG_TESTS: 1 CLEAN_BUILD_ARTIFACTS_ON_SUCCESS: 0 needs: - job: gcc:bookworm:amd64 diff --git a/bin/tests/system/isctest/mark.py b/bin/tests/system/isctest/mark.py index 3bd1e6816e..54be59170d 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -19,7 +19,7 @@ import pytest long_test = pytest.mark.skipif( - not os.environ.get("CI_ENABLE_ALL_TESTS"), reason="CI_ENABLE_ALL_TESTS not set" + not os.environ.get("CI_ENABLE_LONG_TESTS"), reason="CI_ENABLE_LONG_TESTS not set" ) From 3a8ffc74df5f097afa9cd2b7073dc732824e82dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Thu, 19 Jun 2025 09:53:20 +0200 Subject: [PATCH 2/3] Add a pytest mark for system tests that require Internet connection We skip those by default as: a) we don't want to stress the upstream servers in every CI pipeline b) system tests need to be runnable in a isolated environment by default --- .gitlab-ci.yml | 12 ++++++++++-- bin/tests/system/isctest/mark.py | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0df0e483ba..aa8833914e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -263,10 +263,13 @@ stages: rules: - if: '$CI_PIPELINE_SOURCE =~ /^(api|pipeline|schedule|trigger|web)$/' +.default-triggering-rules_list: &default_triggering_rules_list + - if: '$CI_PIPELINE_SOURCE =~ /^(api|merge_request_event|pipeline|schedule|trigger|web)$/' + - if: '$CI_COMMIT_TAG != null' + .default-triggering-rules: &default_triggering_rules rules: - - if: '$CI_PIPELINE_SOURCE =~ /^(api|merge_request_event|pipeline|schedule|trigger|web)$/' - - if: '$CI_COMMIT_TAG != null' + - *default_triggering_rules_list .precheck: &precheck_job <<: *default_triggering_rules @@ -918,6 +921,11 @@ system:gcc:bookworm:amd64: needs: # using artifacts from unit test job is required for gcov - job: unit:gcc:bookworm:amd64 artifacts: true + rules: + - if: '$CI_PIPELINE_SOURCE == "schedule"' + variables: + CI_ENABLE_LIVE_INTERENT_TESTS: 1 + - *default_triggering_rules_list unit:gcc:bookworm:amd64: <<: *debian_bookworm_amd64_image diff --git a/bin/tests/system/isctest/mark.py b/bin/tests/system/isctest/mark.py index 54be59170d..1a2e36f5b8 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -22,6 +22,11 @@ long_test = pytest.mark.skipif( not os.environ.get("CI_ENABLE_LONG_TESTS"), reason="CI_ENABLE_LONG_TESTS not set" ) +live_internet_test = pytest.mark.skipif( + not os.environ.get("CI_ENABLE_LIVE_INTERNET_TESTS"), + reason="CI_ENABLE_LIVE_INTERNET_TESTS not set", +) + def feature_test(feature): feature_test_bin = os.environ["FEATURETEST"] From a69efc678c1e0ee282002ea7afbf93dc104f54ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Bal=C3=A1=C5=BEik?= Date: Wed, 18 Jun 2025 21:06:19 +0200 Subject: [PATCH 3/3] Add a system test that ensures root zone mirroring works out of the box This is a test for #5380. --- bin/tests/system/mirror/ns4/named.conf.j2 | 28 +++++++++++++++++++++++ bin/tests/system/mirror/tests_mirror.py | 27 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 bin/tests/system/mirror/ns4/named.conf.j2 create mode 100644 bin/tests/system/mirror/tests_mirror.py 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 0000000000..4d83d120f1 --- /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 0000000000..98bbdc9194 --- /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")