Commit 76e84fc2 authored by Lubos Slovak's avatar Lubos Slovak Committed by Jan Včelák

tests-extra: CNAME loop + fixed basic/query test.

- Test response with a long CNAME loop.
- Some queries in basic/query test did not have the zone name
  appended, resulting in bogus answers (REFUSED). Not visible,
  because the responses are only compared to ones from Bind.

TODO: Comparison with Bind should be replaced by checks for
      particular requirements for the response.
parent 5b6bfb37
......@@ -123,3 +123,29 @@ sub.*.wildcard A 6.7.8.9
; MX record with name leading to wildcard-covered additional record
mx-additional MX 10 jump.wildcard-additional
*.wildcard-additional A 1.2.3.4
; Really long CNAME loop
ab CNAME bc
bc CNAME cd
cd CNAME de
de CNAME ef
ef CNAME fg
fg CNAME gh
gh CNAME hi
hi CNAME ij
ij CNAME jk
jk CNAME kl
kl CNAME lm
lm CNAME mn
mn CNAME no
no CNAME op
op CNAME pq
pq CNAME qr
qr CNAME rs
rs CNAME st
st CNAME tu
tu CNAME uv
uv CNAME vw
vw CNAME wx
wx CNAME ab
......@@ -2,6 +2,7 @@
''' For various query processing states. '''
from dnstest.utils import *
from dnstest.test import Test
t = Test()
......@@ -113,33 +114,38 @@ 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 = knot.dig("cname-dname.flags", "A", udp=True)
resp.cmp(bind)
# CNAME leading to DNAME tree (NXDOMAIN)
resp = knot.dig("cname-dname-nx", "A", udp=True)
resp = knot.dig("cname-dname-nx.flags", "A", udp=True)
resp.cmp(bind)
# CNAME leading to DNAME tree (NODATA)
resp = knot.dig("cname-dname", "TXT", udp=True)
resp = knot.dig("cname-dname.flags", "TXT", udp=True)
resp.cmp(bind)
# Long CNAME loop (Bind truncates the loop at 17 records)
resp = knot.dig("ab.flags", "A", udp=True)
resp.check(rcode="NOERROR")
compare(resp.count(rtype="CNAME", section="answer"), 23, "Count of CNAME records in loop.")
''' CNAME in Additional '''
# Leading to existing name
resp = knot.dig("cname-mx", "MX", udp=True)
resp = knot.dig("cname-mx.flags", "MX", udp=True)
resp.cmp(bind)
# Leading to delegation
resp = knot.dig("cname-mx-deleg", "MX", udp=True)
resp = knot.dig("cname-mx-deleg.flags", "MX", udp=True)
resp.cmp(bind)
# Leading to wildcard-covered name
resp = knot.dig("cname-mx-wc", "MX", udp=True)
resp = knot.dig("cname-mx-wc.flags", "MX", udp=True)
resp.cmp(bind)
# Leading to name outside zone
resp = knot.dig("cname-mx-out", "MX", udp=True)
resp = knot.dig("cname-mx-out.flags", "MX", udp=True)
resp.cmp(bind)
''' DNAME answers. '''
......
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