From bf87c6745608a360106115ef532d83bdd4cca636 Mon Sep 17 00:00:00 2001 From: Daniel Salzman <daniel.salzman@nic.cz> Date: Sun, 29 Jan 2017 21:01:50 +0100 Subject: [PATCH] tests-extra: udapt test huge_rrset to fixed dnspython 1.16.0 --- tests-extra/tests/records/huge_rrset/test.py | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests-extra/tests/records/huge_rrset/test.py b/tests-extra/tests/records/huge_rrset/test.py index 91edeca226..3926015c87 100644 --- a/tests-extra/tests/records/huge_rrset/test.py +++ b/tests-extra/tests/records/huge_rrset/test.py @@ -39,17 +39,18 @@ resp.check_count(0, section="answer") resp = master.dig(ZONE, "AXFR", tries=1, timeout=5) got_messages = 0 - -for msg in resp.resp: +last_rcode = None + +try: + for msg in resp.resp: + got_messages += 1 + last_rcode = msg.rcode() + compare(msg.rcode(), dns.rcode.NOERROR, "rcode") +except dns.query.TransferError as e: got_messages += 1 - if got_messages is 1: - isset(msg.rcode() == dns.rcode.NOERROR, "NOERROR") - elif got_messages is 2: - isset(msg.rcode() == dns.rcode.SERVFAIL, "SERVFAIL") - break - -if got_messages != 2: - set_err("AXFR MSGCOUNT") - detail_log("!AXFR message count: %i != 1" % got_messages) + last_rcode = e.rcode + +compare(got_messages, 2, "axfr message count") +compare(last_rcode, dns.rcode.SERVFAIL, "last rcode") t.end() -- GitLab