mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 14:29:59 -04:00
Add checking RFC 4592 responses examples to wildcard system test
This commit is contained in:
parent
4e7f7f99b6
commit
3632b3c282
4 changed files with 107 additions and 0 deletions
12
bin/tests/system/wildcard/ns1/example.db.in
Normal file
12
bin/tests/system/wildcard/ns1/example.db.in
Normal file
|
|
@ -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.
|
||||
|
|
@ -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"; };
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue