Commit 1b438a7e authored by Lubos Slovak's avatar Lubos Slovak

Added some more test cases to basic tests.

parent bc21f9cc
......@@ -6,7 +6,7 @@ $TTL 3600
NS dns.out-of-zone. ; NS out-of-zone record
NS dns2
MX 10 mail
MX 20 mail-no-a-rr ; MX record without additional A/AAAA record
MX 20 mail-no-a-rr ; MX record without additional A/AAAA record
dns1 A 192.0.2.1
AAAA 2001:DB8::1
......@@ -30,10 +30,40 @@ cname-ns CNAME sub
; CNAME to out
cname-out CNAME another.world.
; CNAME to wildcard-covered name
cname-wildcard CNAME a.wildcard
; CNAME to DNAME tree
cname-dname CNAME a.dname-tree
; CNAME to DNAME tree (not existing)
cname-dname-nx CNAME b.dname-tree
; CNAMEs in Additional
; MX record leading to CNAME (existing)
cname-mx MX 10 cname
; MX record leading to CNAME (delegation)
cname-mx-deleg MX 10 cname-ns
; MX record leading to CNAME (wildcard-covered)
cname-mx-wc MX 10 cname-wildcard
; MX record leading to CNAME (outside zone)
cname-mx-out MX 10 cname-out
; DNAME subtree
dname DNAME dname-tree
dname-tree A 1.2.3.4
a.dname-tree A 5.6.7.8
c.dname-tree CNAME dns1
d.dname-tree CNAME cname-wildcard
e.dname-tree CNAME e.dname
f.dname-tree DNAME dname-tree
dname-out DNAME outside.zone.
; Fourth level domain with A record
fourth.third.second A 1.1.1.1
......@@ -51,7 +81,7 @@ sub.*.wildcard A 6.7.8.9
*.*.wildcard A 9.8.7.6
; Wildcard under DNAME subtree
*.dname-tree A 8.7.6.5
*.wildcard.dname-tree A 8.7.6.5
; Wildcard to CNAME
*.wildcard-cname CNAME cname
......
......@@ -32,27 +32,27 @@ resp.cmp(bind)
# Positive (SOA)
resp = knot.dig("flags", "SOA", udp=True)
resp.check(rcode="NOERROR")
resp.check(rcode="NOERROR", flags="AA")
resp.cmp(bind)
# Positive (DATA)
resp = knot.dig("dns1.flags", "A", udp=True)
resp.check(rcode="NOERROR")
resp.check(rcode="NOERROR", flags="AA")
resp.cmp(bind)
# Positive (NODATA)
resp = knot.dig("dns1.flags", "TXT", udp=True)
resp.check(rcode="NOERROR")
resp.check(rcode="NOERROR", flags="AA")
resp.cmp(bind)
# Positive (REFERRAL)
resp = knot.dig("sub.flags", "NS", udp=True)
resp.check(rcode="NOERROR")
resp.check(rcode="NOERROR", noflags="AA")
resp.cmp(bind)
# Positive (REFERRAL, below delegation)
resp = knot.dig("ns.sub.flags", "A", udp=True)
resp.check(rcode="NOERROR")
resp.check(rcode="NOERROR", noflags="AA")
resp.cmp(bind)
''' ANY query type. '''
......@@ -104,6 +104,44 @@ resp.cmp(bind)
resp = knot.dig("cname-out.flags", "A", udp=True)
resp.cmp(bind)
# CNAME leading to wildcard-covered name
resp = knot.dig("cname-wildcard.flags", "A", udp=True)
resp.cmp(bind)
# CNAME leading to wildcard-covered name (NODATA)
resp = knot.dig("cname-wildcard.flags", "TXT", udp=True)
resp.cmp(bind)
# CNAME leading to DNAME tree
resp = knot.dig("cname-dname", "A", udp=True)
resp.cmp(bind)
# CNAME leading to DNAME tree (NXDOMAIN)
resp = knot.dig("cname-dname-nx", "A", udp=True)
resp.cmp(bind)
# CNAME leading to DNAME tree (NODATA)
resp = knot.dig("cname-dname", "TXT", udp=True)
resp.cmp(bind)
''' CNAME in Additional '''
# Leading to existing name
resp = knot.dig("cname-mx", "MX", udp=True)
resp.cmp(bind)
# Leading to delegation
resp = knot.dig("cname-mx-deleg", "MX", udp=True)
resp.cmp(bind)
# Leading to wildcard-covered name
resp = knot.dig("cname-mx-wc", "MX", udp=True)
resp.cmp(bind)
# Leading to name outside zone
resp = knot.dig("cname-mx-out", "MX", udp=True)
resp.cmp(bind)
''' DNAME answers. '''
# DNAME query
......@@ -114,6 +152,10 @@ resp.cmp(bind)
resp = knot.dig("dname.flags", "DNAME", udp=True)
resp.cmp(bind)
# DNAME query leading out of zone
resp = knot.dig("a.dname-out.flags", "A", udp=True)
resp.cmp(bind)
# DNAME subtree query leading to A
resp = knot.dig("a.dname.flags", "A", udp=True)
resp.cmp(bind)
......@@ -122,6 +164,22 @@ resp.cmp(bind)
resp = knot.dig("a.dname.flags", "TXT", udp=True)
resp.cmp(bind)
# DNAME subtree query leading to CNAME
resp = knot.dig("c.dname.flags", "A", udp=True)
resp.cmp(bind)
# DNAME subtree query leading to CNAME leading to wildcard
resp = knot.dig("d.dname.flags", "A", udp=True)
resp.cmp(bind)
# DNAME-CNAME-DNAME loop
resp = knot.dig("e.dname.flags", "A", udp=True)
resp.cmp(bind)
# DNAME-DNAME loop
resp = knot.dig("f.dname.flags", "A", udp=True)
resp.cmp(bind)
''' Wildcard answers. '''
# Wildcard query
......@@ -165,11 +223,11 @@ resp = knot.dig("a.*.wildcard.flags", "TXT", udp=True)
resp.cmp(bind)
# Wildcard under DNAME subtree
resp = knot.dig("wildcard.dname.flags", "A", udp=True)
resp = knot.dig("a.wildcard.dname.flags", "A", udp=True)
resp.cmp(bind)
# Wildcard under DNAME subtree (NODATA)
resp = knot.dig("wildcard.dname.flags", "TXT", udp=True)
resp = knot.dig("a.wildcard.dname.flags", "TXT", udp=True)
resp.cmp(bind)
# Wildcard chain to A
......
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