]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Log query and response when using isctest.query.*
authorNicki Křížek <nicki@isc.org>
Thu, 26 Jun 2025 14:14:50 +0000 (16:14 +0200)
committerNicki Křížek <nicki@isc.org>
Fri, 27 Jun 2025 16:09:08 +0000 (18:09 +0200)
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).

(cherry picked from commit 56fec9ba04b3ddb82591d2c9edf4f073d650209c)

bin/tests/system/isctest/query.py
bin/tests/system/limits/tests_limits.py
bin/tests/system/stress/tests_stress_update.py
bin/tests/system/tsiggss/tests_isc_spnego_flaws.py

index 7e1ca1f359dd5d449b92a205365f6d0d260d42e9..13e6eb61e9176b3e2b720859cd1ea56e3f4d16e9 100644 (file)
@@ -31,8 +31,8 @@ def generic_query(
     timeout: int = QUERY_TIMEOUT,
     attempts: int = 10,
     expected_rcode: dns_rcode = None,
-    log_query: bool = False,
-    log_response: bool = False,
+    log_query: bool = True,
+    log_response: bool = True,
 ) -> Any:
     if port is None:
         port = int(os.environ["PORT"])
index 7d6636178cdc8588ba2f5f5aba908fa4651f56ed..1fe5ea008772e51e310ab555cc76ea221b607dde 100644 (file)
@@ -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"
index ca5cf0c51aca83b413141526a669f2e035deb3c8..5bb413df331f6a696e350af0faa73030425b7dee 100644 (file)
@@ -55,7 +55,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}")
index 955d9901e817953975de79ac17f7aee83443ee8f..4c32557e894ea867d59141861673c8e392dacc0a 100755 (executable)
@@ -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():