diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca6d4661f2..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 @@ -912,18 +915,23 @@ 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 - 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 <<: *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..1a2e36f5b8 100644 --- a/bin/tests/system/isctest/mark.py +++ b/bin/tests/system/isctest/mark.py @@ -19,7 +19,12 @@ 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" +) + +live_internet_test = pytest.mark.skipif( + not os.environ.get("CI_ENABLE_LIVE_INTERNET_TESTS"), + reason="CI_ENABLE_LIVE_INTERNET_TESTS not set", ) 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")