From: Nicki Křížek Date: Thu, 26 Jun 2025 14:14:50 +0000 (+0200) Subject: Log query and response when using isctest.query.* X-Git-Tag: v9.21.10~15^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56fec9ba04b3ddb82591d2c9edf4f073d650209c;p=thirdparty%2Fbind9.git Log query and response when using isctest.query.* Make sure the queries and responses are logged at the DEBUG level, which may provide useful information in case of failing tests. This doesn't seem to significantly increase the overall artifacts size. Previously, pytest.log.txt files from all system tests would take around 3 MB, with this change, it's around 8 MB). --- diff --git a/bin/tests/system/isctest/query.py b/bin/tests/system/isctest/query.py index 4b8590fb2f6..6e7bee285ee 100644 --- a/bin/tests/system/isctest/query.py +++ b/bin/tests/system/isctest/query.py @@ -32,8 +32,8 @@ def generic_query( attempts: int = 10, expected_rcode: dns_rcode = None, verify: bool = False, - log_query: bool = False, - log_response: bool = False, + log_query: bool = True, + log_response: bool = True, ) -> Any: if port is None: if query_func.__name__ == "tls": diff --git a/bin/tests/system/limits/tests_limits.py b/bin/tests/system/limits/tests_limits.py index 7d6636178cd..1fe5ea00877 100644 --- a/bin/tests/system/limits/tests_limits.py +++ b/bin/tests/system/limits/tests_limits.py @@ -33,7 +33,7 @@ pytest.importorskip("dns", minversion="2.0.0") ) def test_limits(name, limit): msg_query = dns.message.make_query(f"{name}.example.", "A") - res = isctest.query.tcp(msg_query, "10.53.0.1") + res = isctest.query.tcp(msg_query, "10.53.0.1", log_response=False) iplist = [ f"10.0.{x}.{y}" @@ -47,6 +47,6 @@ def test_limits(name, limit): def test_limit_exceeded(): msg_query = dns.message.make_query("5000.example.", "A") - res = isctest.query.tcp(msg_query, "10.53.0.1") + res = isctest.query.tcp(msg_query, "10.53.0.1", log_response=False) assert res.flags & dns.flags.TC, "TC flag was not set" diff --git a/bin/tests/system/stress/tests_stress_update.py b/bin/tests/system/stress/tests_stress_update.py index 2d5eefd3bf1..cbc678f6ba6 100644 --- a/bin/tests/system/stress/tests_stress_update.py +++ b/bin/tests/system/stress/tests_stress_update.py @@ -54,7 +54,9 @@ def update_zone(test_state, zone): update = dns.update.UpdateMessage(zone) update.add(f"dynamic-{i}.{zone}", 300, "TXT", f"txt-{i}") try: - response = isctest.query.udp(update, server) + response = isctest.query.udp( + update, server, log_query=False, log_response=False + ) assert response.rcode() == dns.rcode.NOERROR except dns.exception.Timeout: isctest.log.info(f"error: query timeout for {zone}") diff --git a/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py b/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py index 955d9901e81..4c32557e894 100755 --- a/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py +++ b/bin/tests/system/tsiggss/tests_isc_spnego_flaws.py @@ -177,9 +177,7 @@ def send_crafted_tkey_query(opts: argparse.Namespace) -> None: query = CraftedTKEYQuery(opts).msg - isctest.query.tcp( - query, opts.server_ip, timeout=2, log_query=True, log_response=True - ) + isctest.query.tcp(query, opts.server_ip, timeout=2) def test_cve_2020_8625():