From 02cf400dc90315ad5e4a0f436c9c38b2c523d28f 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. (cherry picked from commit c7a8f6105578c43f6d1d1a60e54d5c84ad7470a8) --- .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 a1b9b113af..69907f3043 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -998,7 +998,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 @@ -1009,7 +1009,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 fd1a8a0f57..630409fb71 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -20,7 +20,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 e2a91c06c84b0c8bc38602b13c477c32bc5874a6 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 (cherry picked from commit 3a8ffc74df5f097afa9cd2b7073dc732824e82dd) --- .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 69907f3043..54bac6957f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -265,10 +265,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 @@ -1004,6 +1007,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 630409fb71..254ced506c 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -23,6 +23,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 97caa0addcebbb1b48b229bad5b8de61f03d09bf 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. (cherry picked from commit a69efc678c1e0ee282002ea7afbf93dc104f54ae) --- 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")