From: Nicki Křížek Date: Thu, 25 Sep 2025 14:24:57 +0000 (+0200) Subject: Add nsX fixtures to pytest X-Git-Tag: v9.18.41~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cfbf636fe4395938739f6a3d35783e15de9dbcd;p=thirdparty%2Fbind9.git Add nsX fixtures to pytest The nsX are utility fixtures which can be used instead of the servers fixture, which requires longer syntax(i.e. servers["nsX"]). --- diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 1259cc8babd..2ea55e8aa6c 100644 --- a/bin/tests/system/conftest.py +++ b/bin/tests/system/conftest.py @@ -717,7 +717,7 @@ def system_test( request.node.stash[FIXTURE_OK] = True -@pytest.fixture +@pytest.fixture(scope="module") def servers(ports, system_test_dir): instances = {} for entry in system_test_dir.rglob("*"): @@ -733,3 +733,53 @@ def servers(ports, system_test_dir): except ValueError: continue return instances + + +@pytest.fixture(scope="module") +def ns1(servers): + return servers["ns1"] + + +@pytest.fixture(scope="module") +def ns2(servers): + return servers["ns2"] + + +@pytest.fixture(scope="module") +def ns3(servers): + return servers["ns3"] + + +@pytest.fixture(scope="module") +def ns4(servers): + return servers["ns4"] + + +@pytest.fixture(scope="module") +def ns5(servers): + return servers["ns5"] + + +@pytest.fixture(scope="module") +def ns6(servers): + return servers["ns6"] + + +@pytest.fixture(scope="module") +def ns7(servers): + return servers["ns7"] + + +@pytest.fixture(scope="module") +def ns8(servers): + return servers["ns8"] + + +@pytest.fixture(scope="module") +def ns9(servers): + return servers["ns9"] + + +@pytest.fixture(scope="module") +def ns10(servers): + return servers["ns10"]