summaryrefslogtreecommitdiffstats
path: root/tests/integration/deckard/tools/conftest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:00 +0000
commit830407e88f9d40d954356c3754f2647f91d5c06a (patch)
treed6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/integration/deckard/tools/conftest.py
parentInitial commit. (diff)
downloadknot-resolver-upstream.tar.xz
knot-resolver-upstream.zip
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/integration/deckard/tools/conftest.py')
-rw-r--r--tests/integration/deckard/tools/conftest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/integration/deckard/tools/conftest.py b/tests/integration/deckard/tools/conftest.py
new file mode 100644
index 0000000..1b865fb
--- /dev/null
+++ b/tests/integration/deckard/tools/conftest.py
@@ -0,0 +1,19 @@
+import ipaddress
+
+# These are IPs of a.ns.nic.cz
+AUTHORITATIVE_SERVERS = [ipaddress.IPv4Address("194.0.12.1"),
+ ipaddress.IPv6Address("2001:678:f::1")]
+
+
+def pytest_addoption(parser):
+ parser.addoption("--forwarder", action="append", help="IP of forwarder to test")
+
+
+def pytest_generate_tests(metafunc):
+ if 'forwarder' in metafunc.fixturenames:
+ forwarder = metafunc.config.option.forwarder
+ metafunc.parametrize("forwarder", [ipaddress.ip_address(f) for f in forwarder], ids=str)
+ if 'tcp' in metafunc.fixturenames:
+ metafunc.parametrize("tcp", [False, True], ids=lambda x: "TCP" if x else "UDP")
+ if 'server' in metafunc.fixturenames:
+ metafunc.parametrize("server", AUTHORITATIVE_SERVERS, ids=str)