from dnstest.test import Test
import random
-KNSUPDATE = random.choice([True, False])
-detail_log("Using knsupdate %s\n" % str(KNSUPDATE))
-PROTOS = [Proto.TCP, Proto.TLS] + ([Proto.QUIC] if KNSUPDATE else [])
-
-t = Test(tls=True, quic=True, knsupdate=KNSUPDATE)
+t = Test(tls=True, quic=True)
def check_soa(master, prev_soa):
soa_resp = master.dig("ddns.", "SOA")
master.flush(wait=True)
master.zone_verify(zone)
-def do_normal_tests(master, zone, dnssec=False, proto=Proto.TCP):
+def do_normal_tests(master, zone, dnssec=False):
# add node
check_log("Node addition")
up = master.update(zone)
up.add("rrtest.ddns.", 3600, "A", "1.2.3.4")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.4")
verify(master, zone, dnssec)
check_log("Node update - new record")
up = master.update(zone)
up.add("rrtest.ddns.", 3600, "A", "1.2.3.5")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.4")
resp.check(rcode="NOERROR", rdata="1.2.3.5")
up = master.update(zone)
up.add("rrtest.ddns.", 3600, "A", "1.2.3.7")
up.add("rrtest.ddns.", 3600, "A", "1.2.3.0")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.0")
resp.check(rcode="NOERROR", rdata="1.2.3.4")
check_log("Node update - new rrset")
up = master.update(zone)
up.add("rrtest.ddns.", 3600, "TXT", "abcedf")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "TXT")
resp.check(rcode="NOERROR", rdata="abcedf")
resp = master.dig("rrtest.ddns.", "A")
check_log("Node update - rrset removal")
up = master.update(zone)
up.delete("rrtest.ddns.", "TXT")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "TXT")
resp.check(rcode="NOERROR")
compare(resp.count(section="answer"), 0, "TXT rrset removal")
check_log("Node update - record removal")
up = master.update(zone)
up.delete("rrtest.ddns.", "A", "1.2.3.5")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", nordata="1.2.3.5")
resp.check(rcode="NOERROR", rdata="1.2.3.0")
up = master.update(zone)
up.delete("rrtest.ddns.", "A", "1.2.3.0")
up.delete("rrtest.ddns.", "A", "1.2.3.7")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", nordata="1.2.3.0")
resp.check(rcode="NOERROR", nordata="1.2.3.7")
up = master.update(zone)
up.delete("rrtest.ddns.", "ANY")
up.add("rrtest.ddns.", 7, "A", "1.2.3.8")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NOERROR", rdata="1.2.3.8")
verify(master, zone, dnssec)
check_log("Node removal")
up = master.update(zone)
up.delete("rrtest.ddns.", "ANY")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest.ddns.", "A")
resp.check(rcode="NXDOMAIN")
verify(master, zone, dnssec)
up = master.update(zone)
up.add("deleg.ddns.", 3600, "NS", "a.deleg.ddns.")
up.add("a.deleg.ddns.", 3600, "A", "1.2.3.4")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleg.ddns.", "NS")
resp.check_record(section="authority", rtype="NS", rdata="a.deleg.ddns.")
resp.check_record(section="additional", rtype="A", rdata="1.2.3.4")
check_log("Delegation w/o glue")
up = master.update(zone)
up.add("deleglue.ddns.", 3600, "NS", "a.deleglue.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleglue.ddns.", "NS")
resp.check_record(section="authority", rtype="NS", rdata="a.deleglue.ddns.")
resp.check_no_rr(section="additional", rname="a.deleglue.ddns.", rtype="A")
check_log("Glue for existing delegation")
up = master.update(zone)
up.add("a.deleglue.ddns.", 3600, "A", "10.20.30.40")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleglue.ddns.", "NS")
resp.check_record(section="authority", rtype="NS", rdata="a.deleglue.ddns.")
resp.check_record(section="additional", rtype="A", rdata="10.20.30.40")
check_log("Remove delegation, keep glue")
up = master.update(zone)
up.delete("deleglue.ddns.", "NS")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleglue.ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(section="authority", rtype="SOA")
check_log("Add delegation to existing glue")
up = master.update(zone)
up.add("deleglue.ddns.", 3600, "NS", "a.deleglue.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleglue.ddns.", "NS")
resp.check_record(section="authority", rtype="NS", rdata="a.deleglue.ddns.")
resp.check_record(section="additional", rtype="A", rdata="10.20.30.40")
up = master.update(zone)
up.add("a.deleglue.ddns.", 3600, "NS", "a.deleglue.ddns.")
up.delete("deleglue.ddns.", "NS", "a.deleglue.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("x.a.deleglue.ddns.", "A")
resp.check(rcode="NOERROR")
resp.check_record(section="authority", rtype="NS", rdata="a.deleglue.ddns.")
up = master.update(zone)
up.delete("a.deleglue.ddns.", "NS", "a.deleglue.ddns.")
up.add("deleglue.ddns.", 3600, "NS", "a.deleglue.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleglue.ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(section="authority", rtype="NS", rdata="a.deleglue.ddns.")
check_log("glueless SVCB")
up = master.update(zone)
up.add("svcb.ddns.", 3600, "SVCB", "0 target.svcb.svcbtarget.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(0, rtype="AAAA", section="additional")
up = master.update(zone)
up.add("target.svcb.svcbtarget.ddns.", 3600, "AAAA", "1::2")
up.add("target.svcb.svcbtarget.ddns.", 3600, "SVCB", "2 . alpn=h2")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(1, rtype="AAAA", section="additional")
up = master.update(zone)
up.delete("target.svcb.svcbtarget.ddns.", "AAAA")
up.delete("target.svcb.svcbtarget.ddns.", "SVCB")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(0, rtype="AAAA", section="additional")
check_log("SVCB wildcard glue")
up = master.update(zone)
up.add("*.svcbtarget.ddns.", 3600, "AAAA", "1::3")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_record(section="additional", name="*.svcbtarget.ddns.", rtype="AAAA", ttl=3600, rdata="1::3")
check_log("SVCB shuffle")
up.delete("svcb.ddns.", "SVCB")
up.add("svcb.ddns.", 3600, "SVCB", "1 target.svcb.svcbtarget.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_record(section="additional", name="*.svcbtarget.ddns.", rtype="AAAA", ttl=3600, rdata="1::3")
check_log("Remove wildcard glue")
up = master.update(zone)
up.delete("*.svcbtarget.ddns.", "AAAA", "1::3")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
t.sleep(1) # wait for zone_update_cleanup to trigger lost glue
resp = master.dig("svcb.ddns.", "SVCB", dnssec=dnssec)
resp.check(rcode="NOERROR")
# now remove SVCB in order to make ldns-verify work
up = master.update(zone)
up.delete("svcb.ddns.", "SVCB")
- up.send(proto=proto)
+ up.send()
# Add double-wildcard MX
check_log("Double-wildcard MX")
up = master.update(zone)
up.add("double.wc.mx.ddns.", 3600, "MX", "1 a.*.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("double.wc.mx.ddns.", "MX", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(1, rtype="MX", section="answer")
check_log("Double-wildcard glue")
up = master.update(zone)
up.add("*.*.ddns.", 3600, "AAAA", "3::5")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("double.wc.mx.ddns.", "MX", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(1, rtype="MX", section="answer")
up = master.update(zone)
up.delete("double.wc.mx.ddns.", "MX")
up.add("double.wc.mx.ddns.", 3600, "MX", "2 a.*.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("double.wc.mx.ddns.", "MX", dnssec=dnssec)
resp.check(rcode="NOERROR")
resp.check_count(1, rtype="MX", section="answer")
check_log("Remove double-wildcard glue")
up = master.update(zone)
up.delete("*.*.ddns.", "AAAA")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
t.sleep(1) # wait for zone_update_cleanup to trigger lost glue
resp = master.dig("double.wc.mx.ddns.", "MX", dnssec=dnssec)
resp.check(rcode="NOERROR")
check_log("Add CNAME to A node")
up = master.update(zone)
up.add("dns1.ddns.", "3600", "CNAME", "ignore.me.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("dns1.ddns.", "CNAME")
compare(resp.count(), 0, "Added CNAME when it shouldn't")
verify(master, zone, dnssec)
up = master.update(zone)
up.add("rrtest2.ddns.", "3600", "MX", "10 something.ddns.")
up.add("rrtest2.ddns.", "3600", "CNAME", "ignore.me.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest2.ddns.", "ANY")
resp.check(rcode="NOERROR")
resp.check_record(rtype="MX", rdata="10 something.ddns.")
check_log("Add A to CNAME node")
up = master.update(zone)
up.add("cname.ddns.", "3600", "A", "1.2.3.4")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("cname.ddns.", "ANY")
resp.check(rcode="NOERROR")
resp.check_record(rtype="A", nordata="1.2.3.4")
up = master.update(zone)
up.add("rrtest3.ddns.", "3600", "CNAME", "dont.ignore.me.ddns.")
up.add("rrtest3.ddns.", "3600", "TXT", "ignore")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest3.ddns.", "ANY")
resp.check(rcode="NOERROR")
resp.check_record(rtype="TXT", nordata="ignore")
check_log("CNAME to CNAME addition")
up = master.update(zone)
up.add("cname.ddns.", 3600, "CNAME", "new-cname.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("cname.ddns.", "CNAME")
resp.check(rcode="NOERROR", rdata="new-cname.ddns.")
resp.check(rcode="NOERROR", nordata="mail.ddns.")
up = master.update(zone)
up.add("rrtest4.ddns.", "3600", "CNAME", "ignore.me.ddns.")
up.add("rrtest4.ddns.", "3600", "CNAME", "dont.ignore.me.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("rrtest3.ddns.", "ANY")
resp.check(rcode="NOERROR")
resp.check_record(rtype="CNAME", rdata="dont.ignore.me.ddns.")
up = master.update(zone)
up.add("ddns.", 3600, "SOA",
"dns1.ddns. hostmaster.ddns. 2011111213 10800 3600 1209600 7200")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "SOA")
resp.check(rcode="NOERROR",
rdata="dns1.ddns. hostmaster.ddns. 2011111213 10800 3600 1209600 7200")
"dns1.ddns. hostmaster.ddns. 2012111213 10800 3600 1209600 7200")
up.delete("ddns.", "SOA",
"dns1.ddns. hostmaster.ddns. 2012111213 10800 3600 1209600 7200")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "SOA")
resp.check(rcode="NOERROR",
rdata="dns1.ddns. hostmaster.ddns. 2012111213 10800 3600 1209600 7200")
up.add("ddns.", 3600, "SOA",
"dns1.ddns. hostmaster.ddns. 2013111213 10800 3600 1209600 7200")
up.delete("ddns.", "SOA")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "SOA")
resp.check(rcode="NOERROR")
resp.check_record(rtype="SOA", rdata="dns1.ddns. hostmaster.ddns. 2013111213 10800 3600 1209600 7200")
up = master.update(zone)
up.add("ddns.", 3600, "SOA",
"dns1.ddns. hostmaster.ddns. 2010111213 10800 3600 1209600 7200")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "SOA")
resp.check(rcode="NOERROR",
rdata="dns1.ddns. hostmaster.ddns. 2013111213 10800 3600 1209600 7200")
up = master.update(zone)
up.add("ddns.", 1800, "SOA",
"dns1.ddns. hostmaster.ddns. 2014111213 10800 1800 1209600 7200")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "SOA")
resp.check(rcode="NOERROR",
rdata="dns1.ddns. hostmaster.ddns. 2014111213 10800 1800 1209600 7200")
up = master.update(zone)
up.add("testaddrem.ddns.", 3600, "TXT", "record")
up.delete("testaddrem.ddns.", "TXT", "record")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("testaddrem.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
verify(master, zone, dnssec)
up = master.update(zone)
up.add("testaddrem.ddns.", 3600, "TXT", "record")
up.delete("testaddrem.ddns.", "TXT")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("testaddrem.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
verify(master, zone, dnssec)
check_log("Remove non-existent record")
up = master.update(zone)
up.delete("testaddrem.ddns.", "TXT", "record")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
verify(master, zone, dnssec)
# remove NS from APEX (NS should stay)
check_log("Remove NS")
up = master.update(zone)
up.delete("ddns.", "NS")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
check_log("Remove all NS")
up = master.update(zone)
up.delete("ddns.", "ANY")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
up = master.update(zone)
up.delete("ddns.", "NS")
up.add("ddns.", 3600, "NS", "dns3.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
up.delete("ddns.", "NS", "dns2.ddns.")
up.delete("ddns.", "NS", "dns3.ddns.")
up.add("ddns.", 3600, "NS", "dns4.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR", nordata="dns1.ddns.")
resp.check(nordata="dns2.ddns.")
up.add("ddns.", 3600, "NS", "dns5.ddns.")
up.delete("ddns.", "NS", "dns3.ddns.")
up.delete("ddns.", "NS", "dns4.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR", nordata="dns3.ddns.")
resp.check(nordata="dns4.ddns.")
up = master.update(zone)
up.add("ddns.", 3600, "NS", "dns1.ddns.")
up.delete("ddns.", "NS", "dns5.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR", nordata="dns5.ddns.")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
up = master.update(zone)
up.delete("ddns.", "NS", "dns1.ddns.")
up.add("ddns.", 3600, "NS", "dns2.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
up = master.update(zone)
up.delete("ddns.", "NS", "dns1.ddns.")
up.delete("ddns.", "NS", "dns2.ddns.")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check(rcode="NOERROR", nordata="dns1.ddns.")
resp.check_record(rtype="NS", rdata="dns2.ddns.")
up = master.update(zone)
up.add("ddns.", 3600, "NS", "dns1.ddns.")
up.delete("ddns.", "NS")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "NS")
resp.check_record(rtype="NS", rdata="dns1.ddns.")
resp.check_record(rtype="NS", rdata="dns2.ddns.")
check_log("Add empty generic record")
up = master.update(zone)
up.add("empty.ddns.", 300, "TYPE999", "\\# 0")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("empty.ddns.", "TYPE999")
resp.check_record(rtype="TYPE999", rdata="\\# 0")
verify(master, zone, dnssec)
check_log("Add NAPTR record")
up = master.update(zone)
up.add("3.1.1.1.1.1.1.1.1.2.7.9.9.ddns.", 172800, "NAPTR", "1 1 \"u\" \"E2U+sip\" \"!^.*$!sip:123@freeswitch.org!\" .")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("3.1.1.1.1.1.1.1.1.2.7.9.9.ddns.", "NAPTR")
resp.check_record(rtype="NAPTR", rdata="1 1 \"u\" \"E2U+sip\" \"!^.*$!sip:123@freeswitch.org!\" .")
verify(master, zone, dnssec)
check_log("Add TXT into apex")
up = master.update(zone)
up.add("ddns.", 300, "TXT", "This is apeeex!")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("ddns.", "TXT")
resp.check_record(rtype="TXT", rdata="This is apeeex!")
verify(master, zone, dnssec)
up = master.update(zone)
up.add("deleg.ddns.", 3600, "DS",
"54576 10 2 397E50C85EDE9CDE33F363A9E66FD1B216D788F8DD438A57A423A386869C8F06")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("deleg.ddns.", "NS", dnssec=True)
resp.check(rcode="NOERROR")
resp.check_record(section="authority", rtype="DS",
check_log("glue augmentation")
up = master.update(zone)
up.add("a.deleg.ddns.", 3600, "AAAA", "1::2")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("xy.deleg.ddns.", "A", dnssec=True)
resp.check_rr(section="authority", rname="deleg.ddns.", rtype="NS")
resp.check_rr(section="authority", rname="deleg.ddns.", rtype="RRSIG")
resp.check_no_rr(section="additional", rname="a.deleg.ddns.", rtype="RRSIG")
verify(master, zone, dnssec)
-def do_refusal_tests(master, zone, dnssec=False, proto=Proto.TCP):
+def do_refusal_tests(master, zone, dnssec=False):
# Store initial SOA
soa_resp = master.dig("ddns.", "SOA")
prev_soa = soa_resp.resp.answer
check_log("Out-of-zone data")
up = master.update(zone)
up.add("what.the.hell.am.i.doing.here.", "3600", "TXT", "I don't belong here")
- up.send("NOTZONE", proto)
+ up.send("NOTZONE")
check_soa(master, prev_soa)
# Remove 'all' SOA, ignore
check_log("Remove all SOA")
up = master.update(zone)
up.delete("ddns.", "SOA")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
check_soa(master, prev_soa)
# Remove specific SOA, ignore
check_log("Remove specific SOA")
up = master.update(zone)
up.delete("ddns.", "SOA", "dns1.ddns. hostmaster.ddns. 2011111213 10800 3600 1209600 7200")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
check_soa(master, prev_soa)
# Out-of-apex NSEC3PARAM
check_log("Out-of-apex NSEC3PARAM")
up = master.update(zone)
up.add("mx.ddns.", 3600, "NSEC3PARAM", "1 0 0 -")
- up.send("REFUSED", proto)
+ up.send("REFUSED")
check_soa(master, prev_soa)
# Added NSEC3PARAM
check_log("Added NSEC3PARAM")
up = master.update(zone)
up.add("ddns.", 3600, "NSEC3PARAM", "1 0 0 -")
- up.send("REFUSED" if master.dnssec(zone).nsec3 else "NOERROR", proto)
+ up.send("REFUSED" if master.dnssec(zone).nsec3 else "NOERROR")
resp = master.dig("ddns.", "NSEC3PARAM")
resp.check_count(1, "NSEC3PARAM")
if master.dnssec(zone).nsec3:
up = master.update(zone)
up.add("nonapex.ddns.", "3600", "DNSKEY",
"256 3 5 AwEAAbs0AlA6xWQn/lECfGt3S6TaeEmgJfEVVEMh06iNMNWMRHOfbqLF h3N52Ob7trmzlrzGlGLPnAZJvMB8lsFGC5CtaLUBD+4xCh5tl5QifZ+y o+MJvPGlVQI2cs7aMWV9CyFrRmuRcJaSZU2uBz9KFJ955UCq/WIy5KqS 7qaKLzzN")
- up.send("NOERROR", proto)
+ up.send("NOERROR")
resp = master.dig("nonapex.ddns.", "DNSKEY")
resp.check(rcode="NOERROR",
rdata="256 3 5 AwEAAbs0AlA6xWQn/lECfGt3S6TaeEmgJfEVVEMh06iNMNWMRHOfbqLF h3N52Ob7trmzlrzGlGLPnAZJvMB8lsFGC5CtaLUBD+4xCh5tl5QifZ+y o+MJvPGlVQI2cs7aMWV9CyFrRmuRcJaSZU2uBz9KFJ955UCq/WIy5KqS 7qaKLzzN")
t.start()
# DNSSEC-less test
-proto = random.choice(PROTOS)
-check_log("============ Plain test (%s) ===========" % proto)
-do_normal_tests(master_plain, zone, proto=proto)
-do_refusal_tests(master_plain, zone, proto=proto)
+check_log("============ Plain test ===========")
+do_normal_tests(master_plain, zone)
+do_refusal_tests(master_plain, zone)
# DNSSEC with NSEC test
-proto = random.choice(PROTOS)
-check_log("============ NSEC test (%s) ============" % proto)
-do_normal_tests(master_nsec, zone, dnssec=True, proto=proto)
-do_refusal_tests(master_nsec, zone, dnssec=True, proto=proto)
+check_log("============ NSEC test ============")
+do_normal_tests(master_nsec, zone, dnssec=True)
+do_refusal_tests(master_nsec, zone, dnssec=True)
# DNSSEC with NSEC3 test
-proto = random.choice(PROTOS)
-check_log("============ NSEC3 test (%s) ===========" % proto)
-do_normal_tests(master_nsec3, zone, dnssec=True, proto=proto)
-do_refusal_tests(master_nsec3, zone, dnssec=True, proto=proto)
+check_log("============ NSEC3 test ===========")
+do_normal_tests(master_nsec3, zone, dnssec=True)
+do_refusal_tests(master_nsec3, zone, dnssec=True)
t.end()
from dnstest.test import Test
import random
-KNSUPDATE = random.choice([True, False])
-PROTOS = [Proto.TCP, Proto.TLS] + ([Proto.QUIC] if KNSUPDATE else [])
-PROTO = random.choice(PROTOS)
-XDP = True if PROTO == Proto.TCP else False # QUIC has the same port as QUIC+XDP, which does not work with DDNS
-detail_log("Using knsupdate %s %s\n" % (str(KNSUPDATE), str(PROTO)))
-
-t = Test(tls=True, quic=True, knsupdate=KNSUPDATE)
-srv = t.server("knot", xdp_enable=XDP)
+t = Test(tls=True, quic=True)
+srv = t.server("knot")
zone = t.zone("ddns.", storage=".")
t.link(zone, srv, ddns=True)
update = srv.update(zone)
update.prereq_yx("existing.ddns.")
update.add("1.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("1.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_yx("ddns.")
update.add("2.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("2.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_yx("nonexistent.ddns.")
update.add("3.ddns.", 1, "TXT", "text")
-update.send("NXDOMAIN", proto=PROTO)
+update.send("NXDOMAIN")
resp = srv.dig("3.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("nonexistent.")
update.add("4.ddns.", 1, "TXT", "text")
-update.send("NOTZONE", proto=PROTO)
+update.send("NOTZONE")
resp = srv.dig("4.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_nx("nonexistent.ddns.")
update.add("4.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("4.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_nx("existing.ddns.")
update.add("5.ddns.", 1, "TXT", "text")
-update.send("YXDOMAIN", proto=PROTO)
+update.send("YXDOMAIN")
resp = srv.dig("5.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_nx("nonexistent.")
update.add("6.ddns.", 1, "TXT", "text")
-update.send("NOTZONE", proto=PROTO)
+update.send("NOTZONE")
resp = srv.dig("6.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_nx("nonexistent.ddns.", "TYPE65535")
update.add("7.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("7.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_nx("existing.ddns.", "TYPE65535")
update.add("8.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("8.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_nx("existing.ddns.", "A")
update.add("9.ddns.", 1, "TXT", "text")
-update.send("YXRRSET", proto=PROTO)
+update.send("YXRRSET")
resp = srv.dig("9.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_nx("nonexistent.", "TYPE65535")
update.add("10.ddns.", 1, "TXT", "text")
-update.send("NOTZONE", proto=PROTO)
+update.send("NOTZONE")
resp = srv.dig("10.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_nx("a.wildcard.ddns.", "TYPE65535")
update.add("11.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("11.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_nx("a.wildcard.ddns.", "A")
update.add("12.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("12.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_nx("*.wildcard.ddns.", "A")
update.add("13.ddns.", 1, "TXT", "text")
-update.send("YXRRSET", proto=PROTO)
+update.send("YXRRSET")
resp = srv.dig("13.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("nonexistent.ddns.", "TYPE65535")
update.add("13.ddns.", 1, "TXT", "text")
-update.send("NXRRSET", proto=PROTO)
+update.send("NXRRSET")
resp = srv.dig("13.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("existing.ddns.", "TYPE65535")
update.add("14.ddns.", 1, "TXT", "text")
-update.send("NXRRSET", proto=PROTO)
+update.send("NXRRSET")
resp = srv.dig("14.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("existing.ddns.", "A")
update.add("15.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("15.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_yx("existing.ddns.", "A", "1.2.3.4")
update.add("16.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("16.ddns.", "TXT")
resp.check("text")
update = srv.update(zone)
update.prereq_yx("existing.ddns.", "A", "1.2.3.255")
update.add("17.ddns.", 1, "TXT", "text")
-update.send("NXRRSET", proto=PROTO)
+update.send("NXRRSET")
resp = srv.dig("17.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("nonexistent.", "TYPE65535")
update.add("18.ddns.", 1, "TXT", "text")
-update.send("NOTZONE", proto=PROTO)
+update.send("NOTZONE")
resp = srv.dig("18.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("a.wildcard.ddns.", "TYPE65535")
update.add("19.ddns.", 1, "TXT", "text")
-update.send("NXRRSET", proto=PROTO)
+update.send("NXRRSET")
resp = srv.dig("19.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("a.wildcard.ddns.", "A")
update.add("20.ddns.", 1, "TXT", "text")
-update.send("NXRRSET", proto=PROTO)
+update.send("NXRRSET")
resp = srv.dig("20.ddns.", "TXT")
resp.check(rcode="NXDOMAIN")
update = srv.update(zone)
update.prereq_yx("*.wildcard.ddns.", "A")
update.add("21.ddns.", 1, "TXT", "text")
-update.send("NOERROR", proto=PROTO)
+update.send("NOERROR")
resp = srv.dig("21.ddns.", "TXT")
resp.check("text")