From: Mark Andrews Date: Tue, 2 Jun 2020 02:38:40 +0000 (+1000) Subject: Add checking RFC 4592 responses examples to wildcard system test X-Git-Tag: v9.17.3~52^2~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3632b3c2829db6ce15146e736a47f79ce1837c32;p=thirdparty%2Fbind9.git Add checking RFC 4592 responses examples to wildcard system test --- diff --git a/bin/tests/system/wildcard/ns1/example.db.in b/bin/tests/system/wildcard/ns1/example.db.in new file mode 100644 index 00000000000..56da153e4aa --- /dev/null +++ b/bin/tests/system/wildcard/ns1/example.db.in @@ -0,0 +1,12 @@ +$ORIGIN example. +example. 3600 IN SOA . . 0 0 0 0 0 +example. 3600 NS ns.example.com. +example. 3600 NS ns.example.net. +*.example. 3600 TXT "this is a wildcard" +*.example. 3600 MX 10 host1.example. +sub.*.example. 3600 TXT "this is not a wildcard" +host1.example. 3600 A 192.0.2.1 +_ssh._tcp.host1.example. 3600 SRV 0 0 22 host1.example. +_ssh._tcp.host2.example. 3600 SRV 0 0 22 host2.example. +subdel.example. 3600 NS ns.example.com. +subdel.example. 3600 NS ns.example.net. diff --git a/bin/tests/system/wildcard/ns1/named.conf.in b/bin/tests/system/wildcard/ns1/named.conf.in index 95eba8a9e46..8a66b1b811c 100644 --- a/bin/tests/system/wildcard/ns1/named.conf.in +++ b/bin/tests/system/wildcard/ns1/named.conf.in @@ -24,6 +24,10 @@ options { zone "." { type master; file "root.db.signed"; }; +/* + * RFC 4592 example zone. + */ +zone "example" { type master; file "example.db"; }; zone "nsec" { type master; file "nsec.db.signed"; }; zone "private.nsec" { type master; file "private.nsec.db.signed"; }; diff --git a/bin/tests/system/wildcard/ns1/sign.sh b/bin/tests/system/wildcard/ns1/sign.sh index e28519ca1c7..cdd7fe94aae 100755 --- a/bin/tests/system/wildcard/ns1/sign.sh +++ b/bin/tests/system/wildcard/ns1/sign.sh @@ -15,6 +15,9 @@ SYSTESTDIR=wildcard dssets= +# RFC 4592 example zone. +cp example.db.in example.db + zone=nsec infile=nsec.db.in zonefile=nsec.db diff --git a/bin/tests/system/wildcard/tests.sh b/bin/tests/system/wildcard/tests.sh index 1abdd3f742e..86884363839 100644 --- a/bin/tests/system/wildcard/tests.sh +++ b/bin/tests/system/wildcard/tests.sh @@ -142,5 +142,93 @@ grep -i 'flags:.* ad[ ;]' dig.out.ns4.test$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` +echo_i "checking RFC 4592 responses ..." + +n=`expr $n + 1` +echo_i "checking RFC 4592: host3.example. QTYPE=MX, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 host3.example. MX IN > dig.out.ns1.test$n || ret=1 +grep '^host3.example..*IN.MX.10 host1.example.' dig.out.ns1.test$n > /dev/null || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 1," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: host3.example. QTYPE=A, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 host3.example. A IN > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: foo.bar.example. QTYPE=TXT, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 foo.bar.example TXT IN > dig.out.ns1.test$n || ret=1 +grep '^foo.bar.example..*IN.TXT."this is a wildcard"' dig.out.ns1.test$n > /dev/null || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 1," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: host1.example. QTYPE=MX, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 host1.example MX IN > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: host1.example. QTYPE=MX, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 host1.example MX IN > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: sub.*.example. QTYPE=MX, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 "sub.*.example." MX IN > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: _telnet._tcp.host1.example. QTYPE=SRV, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 _telnet._tcp.host1.example. SRV IN > dig.out.ns1.test$n || ret=1 +grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: host.subdel.example. QTYPE=A, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 host.subdel.example A IN > dig.out.ns1.test$n || ret=1 +grep "status: NOERROR" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +grep "AUTHORITY: 2," dig.out.ns1.test$n > /dev/null || ret=1 +grep "subdel.example..*IN.NS.ns.example.com." dig.out.ns1.test$n > /dev/null || ret=1 +grep "subdel.example..*IN.NS.ns.example.net." dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + +n=`expr $n + 1` +echo_i "checking RFC 4592: ghost.*.example. QTYPE=MX, QCLASS=IN ($n)" +ret=0 +$DIG $DIGOPTS @10.53.0.1 "ghost.*.example" MX IN > dig.out.ns1.test$n || ret=1 +grep "status: NXDOMAIN" dig.out.ns1.test$n > /dev/null || ret=1 +grep "ANSWER: 0," dig.out.ns1.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1