mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-07 17:12:04 -04:00
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.
(cherry picked from commit 4cb52f072e)
This commit is contained in:
parent
72626cf940
commit
8f5fcf6441
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue