2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

Test simple NODATA answers with NSEC3

(cherry picked from commit a92391f60f749f133f80a8ee9e3cee38265f3045)
This commit is contained in:
Petr Špaček 2025-06-09 11:15:04 +02:00
parent 827258fb37
commit 6f37f5dc85

View File

@ -30,7 +30,7 @@ import dns.rdtypes.ANY.RRSIG
import dns.rdtypes.ANY.NSEC3
import dns.rrset
from isctest.hypothesis.strategies import dns_names
from isctest.hypothesis.strategies import dns_names, sampled_from
import isctest
import isctest.name
@ -55,6 +55,19 @@ def do_test_query(
return response, NSEC3Checker(response)
@pytest.mark.parametrize(
"server", [pytest.param(AUTH, id="ns3"), pytest.param(RESOLVER, id="ns4")]
)
@given(qname=sampled_from(sorted(ZONE.reachable)))
def test_nodata(server, qname: dns.name.Name, named_port: int) -> None:
"""An existing name, no wildcards, but a query type for RRset which does not exist"""
response, nsec3check = do_test_query(qname, dns.rdatatype.HINFO, server, named_port)
assert response.rcode() is dns.rcode.NOERROR
nsec3check.prove_name_exists(qname)
nsec3check.check_extraneous_rrs()
def assume_nx_and_no_delegation(qname):
assume(qname not in ZONE.all_existing_names)