diff options
author | Libor Peltan <libor.peltan@nic.cz> | 2024-02-08 18:22:32 +0100 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-05-07 07:52:29 +0200 |
commit | fdad47e267c17f2840f8b5d38b1ffcf0ba7d3ae7 (patch) | |
tree | e7e81444ac794fe2c10ce156156bef56b2472f84 /tests-extra/tools/dnstest | |
parent | libknot/quic: code moved (diff) | |
download | knot-fdad47e267c17f2840f8b5d38b1ffcf0ba7d3ae7.tar.xz knot-fdad47e267c17f2840f8b5d38b1ffcf0ba7d3ae7.zip |
implemented DoT for queries and XFR
Diffstat (limited to 'tests-extra/tools/dnstest')
-rw-r--r-- | tests-extra/tools/dnstest/server.py | 21 | ||||
-rw-r--r-- | tests-extra/tools/dnstest/test.py | 9 |
2 files changed, 19 insertions, 11 deletions
diff --git a/tests-extra/tools/dnstest/server.py b/tests-extra/tools/dnstest/server.py index a4f61af63..d4c53263a 100644 --- a/tests-extra/tools/dnstest/server.py +++ b/tests-extra/tools/dnstest/server.py @@ -162,6 +162,7 @@ class Server(object): self.port = 53 # Needed for keymgr when port not yet generated self.xdp_port = None # 0 indicates that XDP is enabled but port not yet assigned self.quic_port = None + self.tls_port = None self.cert_key = str() self.udp_workers = None self.bg_workers = None @@ -1367,6 +1368,8 @@ class Knot(Server): s.item_str("listen", "%s@%s" % (self.addr, self.port)) if self.quic_port: s.item_str("listen-quic", "%s@%s" % (self.addr, self.quic_port)) + if self.tls_port: + s.item_str("listen-tls", "%s@%s" % (self.addr, self.tls_port)) if self.udp_workers: s.item_str("udp-workers", self.udp_workers) if self.bg_workers: @@ -1427,9 +1430,9 @@ class Knot(Server): s.begin("remote") have_remote = True s.id_item("id", master.name) - if master.quic_port: - s.item_str("address", "%s@%s" % (master.addr, master.quic_port)) - s.item_str("quic", "on") + if master.quic_port or master.tls_port: + s.item_str("address", "%s@%s" % (master.addr, master.tls_port or master.quic_port)) + s.item_str("tls" if master.tls_port else "quic", "on") if master.cert_key: s.item_str("cert-key", master.cert_key) else: @@ -1450,9 +1453,9 @@ class Knot(Server): s.begin("remote") have_remote = True s.id_item("id", slave.name) - if slave.quic_port: - s.item_str("address", "%s@%s" % (slave.addr, slave.quic_port)) - s.item_str("quic", "on") + if slave.quic_port or slave.tls_port: + s.item_str("address", "%s@%s" % (slave.addr, slave.tls_port or slave.quic_port)) + s.item_str("tls" if slave.tls_port else "quic", "on") if slave.cert_key: s.item_str("cert-key", slave.cert_key) else: @@ -1484,9 +1487,9 @@ class Knot(Server): s.begin("remote") have_remote = True s.id_item("id", remote.name) - if remote.quic_port: - s.item_str("address", "%s@%s" % (remote.addr, remote.quic_port)) - s.item_str("quic", "on") + if remote.quic_port or remote.tls_port: + s.item_str("address", "%s@%s" % (remote.addr, remote.tls_port or remote.quic_port)) + s.item_str("tls" if remote.tls_port else "quic", "on") if remote.cert_key: s.item_str("cert-key", remote.cert_key) else: diff --git a/tests-extra/tools/dnstest/test.py b/tests-extra/tools/dnstest/test.py index 2fc90b211..5ea03c35e 100644 --- a/tests-extra/tools/dnstest/test.py +++ b/tests-extra/tools/dnstest/test.py @@ -38,7 +38,7 @@ class Test(object): rel_time = time.time() start_time = 0 - def __init__(self, address=None, tsig=None, stress=True, quic=False): + def __init__(self, address=None, tsig=None, stress=True, quic=False, tls=False): if not os.path.exists(Context().out_dir): raise Exception("Output directory doesn't exist") @@ -46,6 +46,7 @@ class Test(object): self.data_dir = Context().test_dir + "/data/" self.zones_dir = self.out_dir + "/zones/" self.quic = quic + self.tls = tls if address == 4 or address == 6: self.addr = Test.LOCAL_ADDR_COMMON[address] @@ -240,7 +241,11 @@ class Test(object): server.port = self._gen_port() server.ctlport = self._gen_port() - server.quic_port = self._gen_port() if self.quic else None + if self.tls: + server.tls_port = self._gen_port() + server.quic_port = server.tls_port if self.quic else None + else: + server.quic_port = self._gen_port() if self.quic else None server.xdp_port = self._gen_port() if server.xdp_port is not None else None for server in self.servers: |