Commit cc36383d authored by Alexandre's avatar Alexandre
Browse files

Allow REFUSED rcode in DNS with truncated test

parent a69be136
......@@ -940,8 +940,8 @@ def run_check_mime(connection, accept="application/dns-message", content_type="a
def run_check_trunc(connection):
# send truncated DNS request to the server and expect a HTTP return code
# either equal to 200 or in the 400 range
# in case the server answers with 200, look for a FORMERR error in the DNS
# response
# in case the server answers with 200, look for a FORMERR or REFUSED error
# in the DNS response
ok = True
test_name = 'Test truncated data'
if verbose:
......@@ -971,9 +971,11 @@ def run_check_trunc(connection):
return ok
if request.check_response(debug): # FORMERR is expected
if dot:
ok = request.rcode == dns.rcode.FORMERR
ok = (request.rcode == dns.rcode.FORMERR or
request.rcode == dns.rcode.REFUSED)
else:
ok = (request.response.rcode() == dns.rcode.FORMERR)
ok = (request.response.rcode() == dns.rcode.FORMERR or
request.response.rcode() == dns.rcode.REFUSED)
else:
if dot:
ok = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment