From 3cfbf636fe4395938739f6a3d35783e15de9dbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Thu, 25 Sep 2025 16:24:57 +0200 Subject: [PATCH] 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"]). --- bin/tests/system/conftest.py | 52 +++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/conftest.py b/bin/tests/system/conftest.py index 1259cc8bab..2ea55e8aa6 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"]