From: Michal Nowak Date: Fri, 27 Sep 2024 11:38:00 +0000 (+0200) Subject: Report expected and last returned rcode on query timeout X-Git-Tag: v9.21.2~6^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cb52f072e2dd8625e79d3538546a206828646ac;p=thirdparty%2Fbind9.git Report expected and last returned rcode on query timeout Sometimes it's useful to see what was the server returning that did not match the expected rcode. --- diff --git a/bin/tests/system/isctest/query.py b/bin/tests/system/isctest/query.py index 2fc1cccdfe1..5662d1e3807 100644 --- a/bin/tests/system/isctest/query.py +++ b/bin/tests/system/isctest/query.py @@ -48,6 +48,11 @@ def generic_query( except (dns.exception.Timeout, ConnectionRefusedError) as e: isctest.log.debug(f"{query_func.__name__}(): the '{e}' exceptio raised") time.sleep(1) + if expected_rcode is not None: + last_rcode = dns_rcode.to_text(res.rcode()) if res else None + isctest.log.debug( + f"{query_func.__name__}(): expected rcode={dns_rcode.to_text(expected_rcode)}, last rcode={last_rcode}" + ) raise dns.exception.Timeout