From 2c4ebdffe150ffd3bc2842df49601e34ff99e4e4 Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Thu, 9 Jul 2015 15:15:07 +0200 Subject: [PATCH] tests-extra: enable additionals checking for selected tests The Additional section of the answers should be compared with BIND on expected delegations. Knot DNS also puts A/AAAA records into the Additional section for NS, MX, and SRV records. --- tests-extra/tests/basic/flags/test.py | 4 ++-- tests-extra/tests/basic/nsec/test.py | 12 ++++++------ tests-extra/tests/basic/nsec3/test.py | 12 ++++++------ tests-extra/tests/basic/opt-out/test.py | 2 +- tests-extra/tests/basic/query/test.py | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests-extra/tests/basic/flags/test.py b/tests-extra/tests/basic/flags/test.py index 636aec3ba..7d487a224 100644 --- a/tests-extra/tests/basic/flags/test.py +++ b/tests-extra/tests/basic/flags/test.py @@ -41,7 +41,7 @@ resp.cmp(bind) # AA flag must be cleared resp = knot.dig("sub.flags", "NS", flags="AA") resp.check(flags="QR", noflags="AA TC RD RA AD CD") -resp.cmp(bind) +resp.cmp(bind, additional=True) # RA flag must be cleared resp = knot.dig("flags", "NS", flags="RA") @@ -51,7 +51,7 @@ resp.cmp(bind) # NS record for delegated subdomain (not authoritative). resp = knot.dig("sub.flags", "NS") resp.check(flags="QR", noflags="AA TC RD RA AD CD") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Glue record for delegated subdomain (not authoritative). resp = knot.dig("ns.sub.flags", "A") diff --git a/tests-extra/tests/basic/nsec/test.py b/tests-extra/tests/basic/nsec/test.py index 9fca59365..c2fe503e2 100644 --- a/tests-extra/tests/basic/nsec/test.py +++ b/tests-extra/tests/basic/nsec/test.py @@ -34,12 +34,12 @@ resp.cmp(bind) # B4. Referral to Signed Zone. resp = knot.dig("mc.a.example", "MX", dnssec=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B5. Referral to Unsigned Zone. resp = knot.dig("mc.b.example", "MX", dnssec=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B6. Wildcard Expansion. resp = knot.dig("a.z.w.example", "MX", dnssec=True) @@ -69,12 +69,12 @@ resp.cmp(bind) # Wildcard Expansion below delegation point resp = knot.dig("a.a.example", "A", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Wildcard Expansion below delegation point (no data) resp = knot.dig("a.a.example", "AAAA", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Direct wildcard query (positive) resp = knot.dig("*.w.example", "MX", dnssec=True) @@ -89,12 +89,12 @@ resp.cmp(bind) # Direct wildcard query below delegation point (positive) resp = knot.dig("*.a.example", "A", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Direct wildcard query below delegation point (no data) resp = knot.dig("*.a.example", "AAAA", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B8. DS Child Zone No Data Error. resp = knot.dig("example", "DS", dnssec=True) diff --git a/tests-extra/tests/basic/nsec3/test.py b/tests-extra/tests/basic/nsec3/test.py index b56136511..4357ef03d 100644 --- a/tests-extra/tests/basic/nsec3/test.py +++ b/tests-extra/tests/basic/nsec3/test.py @@ -34,12 +34,12 @@ resp.cmp(bind) # B4. Referral to Signed Zone. resp = knot.dig("mc.a.example", "MX", dnssec=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B5. Referral to Unsigned Zone. resp = knot.dig("mc.b.example", "MX", dnssec=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B6. Wildcard Expansion. resp = knot.dig("a.z.w.example", "MX", dnssec=True) @@ -69,12 +69,12 @@ resp.cmp(bind) # Wildcard Expansion below delegation point resp = knot.dig("a.a.example", "A", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Wildcard Expansion below delegation point (no data) resp = knot.dig("a.a.example", "AAAA", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Direct wildcard query (positive) resp = knot.dig("*.w.example", "MX", dnssec=True) @@ -89,12 +89,12 @@ resp.cmp(bind) # Direct wildcard query below delegation point (positive) resp = knot.dig("*.a.example", "A", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Direct wildcard query below delegation point (no data) resp = knot.dig("*.a.example", "AAAA", dnssec=True) resp.check(rcode="NOERROR", flags="QR", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B8. DS Child Zone No Data Error. resp = knot.dig("example", "DS", dnssec=True) diff --git a/tests-extra/tests/basic/opt-out/test.py b/tests-extra/tests/basic/opt-out/test.py index af2634f2f..8df1fc8fd 100644 --- a/tests-extra/tests/basic/opt-out/test.py +++ b/tests-extra/tests/basic/opt-out/test.py @@ -34,7 +34,7 @@ resp.cmp(bind) # B3. Referral to an Opt-Out Unsigned Zone. resp = knot.dig("mc.c.example.", "MX", dnssec=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA", eflags="DO") -resp.cmp(bind) +resp.cmp(bind, additional=True) # B4. Wildcard Expansion. resp = knot.dig("a.z.w.example.", "MX", dnssec=True) diff --git a/tests-extra/tests/basic/query/test.py b/tests-extra/tests/basic/query/test.py index 6e2fff2b5..525ab36c1 100644 --- a/tests-extra/tests/basic/query/test.py +++ b/tests-extra/tests/basic/query/test.py @@ -49,12 +49,12 @@ resp.cmp(bind) # Positive (REFERRAL) resp = knot.dig("sub.flags", "NS", udp=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA TC AD RA") -resp.cmp(bind) +resp.cmp(bind, additional=True) # Positive (REFERRAL, below delegation) resp = knot.dig("ns.sub.flags", "A", udp=True) resp.check(rcode="NOERROR", flags="QR", noflags="AA TC AD RA") -resp.cmp(bind) +resp.cmp(bind, additional=True) ''' ANY query type. ''' @@ -68,7 +68,7 @@ resp.cmp(bind) # ANY to delegation point resp = knot.dig("sub.flags", "ANY", udp=True) -resp.cmp(bind) +resp.cmp(bind, additional=True) # ANY to CNAME record resp = knot.dig("cname.flags", "ANY", udp=True) @@ -95,11 +95,11 @@ resp.cmp(bind) # CNAME leading to delegation resp = knot.dig("cname-ns.flags", "NS", udp=True) -resp.cmp(bind) +resp.cmp(bind, additional=True) # CNAME leading below delegation resp = knot.dig("a.cname-ns.flags", "A", udp=True) -resp.cmp(bind) +resp.cmp(bind, additional=True) # CNAME leading out resp = knot.dig("cname-out.flags", "A", udp=True) @@ -246,7 +246,7 @@ resp.cmp(bind) # Wildcard chain to NS resp = knot.dig("a.wildcard-deleg.flags", "NS", udp=True) -resp.cmp(bind) +resp.cmp(bind, additional=True) # Wildcard leading out resp = knot.dig("a.wildcard-out.flags", "A", udp=True)