]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test cipher-suites after zone transfers complete
authorNicki Křížek <nicki@isc.org>
Wed, 28 Aug 2024 13:03:27 +0000 (15:03 +0200)
committerMichal Nowak <mnowak@isc.org>
Fri, 24 Jan 2025 08:45:51 +0000 (08:45 +0000)
Ensure the zone transfers have completed (successfully or not) before
running the test cases, because they assume zone transfers have been
done.

.gitlab-ci.yml
bin/tests/system/cipher-suites/tests_cipher_suites.py
bin/tests/system/vulture_ignore_list.py [new file with mode: 0644]

index 7034b9aa0f8444615c5b203211cc0065d985fd67..0b4637f9b91622b7c1227269aa23c938441c1250 100644 (file)
@@ -586,7 +586,7 @@ pylint:
   script:
     - pylint --rcfile $CI_PROJECT_DIR/.pylintrc $(git ls-files '*.py' | grep -vE '(ans\.py|dangerfile\.py|^bin/tests/system/|^contrib/)')
       # Ignore Pylint wrong-import-position error in system test to enable use of pytest.importorskip
-    - pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE 'ans\.py')
+    - pylint --rcfile $CI_PROJECT_DIR/.pylintrc --disable=wrong-import-position $(git ls-files 'bin/tests/system/*.py' | grep -vE '(ans\.py|vulture_ignore_list\.py)')
 
 reuse:
   <<: *precheck_job
index 255fc326acd11d3a540fd01d887f9f4349ad71a3..1be3aafbbcb1ffa62f73c591d2f77786fe046561 100644 (file)
@@ -9,6 +9,8 @@
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
+import re
+
 import pytest
 
 pytest.importorskip("dns", minversion="2.5.0")
@@ -26,6 +28,17 @@ pytestmark = pytest.mark.extra_artifacts(
 )
 
 
+@pytest.fixture(scope="module")
+def transfers_complete(servers):
+    for zone in ["example", "example-aes-128", "example-aes-256", "example-chacha-20"]:
+        pattern = re.compile(
+            f"transfer of '{zone}/IN' from 10.53.0.1#[0-9]+: Transfer completed"
+        )
+        for ns in ["ns2", "ns3", "ns4", "ns5"]:
+            with servers[ns].watch_log_from_start() as watcher:
+                watcher.wait_for_line(pattern)
+
+
 @pytest.mark.requires_zones_loaded("ns1", "ns2", "ns3", "ns4", "ns5")
 @pytest.mark.parametrize(
     "qname,ns,rcode",
@@ -69,7 +82,8 @@ pytestmark = pytest.mark.extra_artifacts(
         ),
     ],
 )
-def test_cipher_suites_tls_xfer(qname, ns, rcode):
+# pylint: disable=redefined-outer-name,unused-argument
+def test_cipher_suites_tls_xfer(qname, ns, rcode, transfers_complete):
     msg = dns.message.make_query(qname, "AXFR")
     ans = isctest.query.tls(msg, f"10.53.0.{ns}")
     assert ans.rcode() == rcode
diff --git a/bin/tests/system/vulture_ignore_list.py b/bin/tests/system/vulture_ignore_list.py
new file mode 100644 (file)
index 0000000..7682a47
--- /dev/null
@@ -0,0 +1,13 @@
+# 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.
+
+transfers_complete  # unused function (cipher-suites/tests_cipher_suites.py:31)
+transfers_complete  # unused variable (cipher-suites/tests_cipher_suites.py:86)