Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / resolver / tests.sh
blobd9d76f5d3dd02b8cf289743b31c7da04127b23d4
1 #!/bin/sh
3 # Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000, 2001 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: tests.sh,v 1.11 2009/05/29 23:47:49 tbox Exp
20 SYSTEMTESTTOP=..
21 . $SYSTEMTESTTOP/conf.sh
23 status=0
25 echo "I:checking handling of bogus referrals"
26 # If the server has the "INSIST(!external)" bug, this query will kill it.
27 $DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
29 echo "I:check handling of cname + other data / 1"
30 $DIG +tcp cname1.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
32 echo "I:check handling of cname + other data / 2"
33 $DIG +tcp cname2.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
35 echo "I:check that server is still running"
36 $DIG +tcp www.example.com. a @10.53.0.1 -p 5300 >/dev/null || status=1
38 echo "I:checking answer IPv4 address filtering (deny)"
39 ret=0
40 $DIG +tcp www.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
41 grep "status: SERVFAIL" dig.out > /dev/null || ret=1
42 if [ $ret != 0 ]; then echo "I:failed"; fi
43 status=`expr $status + $ret`
45 echo "I:checking answer IPv6 address filtering (deny)"
46 ret=0
47 $DIG +tcp www.example.net @10.53.0.1 aaaa -p 5300 > dig.out || ret=1
48 grep "status: SERVFAIL" dig.out > /dev/null || ret=1
49 if [ $ret != 0 ]; then echo "I:failed"; fi
50 status=`expr $status + $ret`
52 echo "I:checking answer IPv4 address filtering (accept)"
53 ret=0
54 $DIG +tcp www.example.org @10.53.0.1 a -p 5300 > dig.out || ret=1
55 grep "status: NOERROR" dig.out > /dev/null || ret=1
56 if [ $ret != 0 ]; then echo "I:failed"; fi
57 status=`expr $status + $ret`
59 echo "I:checking answer IPv6 address filtering (accept)"
60 ret=0
61 $DIG +tcp www.example.org @10.53.0.1 aaaa -p 5300 > dig.out || ret=1
62 grep "status: NOERROR" dig.out > /dev/null || ret=1
63 if [ $ret != 0 ]; then echo "I:failed"; fi
64 status=`expr $status + $ret`
66 echo "I:checking CNAME target filtering (deny)"
67 ret=0
68 $DIG +tcp badcname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
69 grep "status: SERVFAIL" dig.out > /dev/null || ret=1
70 if [ $ret != 0 ]; then echo "I:failed"; fi
71 status=`expr $status + $ret`
73 echo "I:checking CNAME target filtering (accept)"
74 ret=0
75 $DIG +tcp goodcname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
76 grep "status: NOERROR" dig.out > /dev/null || ret=1
77 if [ $ret != 0 ]; then echo "I:failed"; fi
78 status=`expr $status + $ret`
80 echo "I:checking CNAME target filtering (accept due to subdomain)"
81 ret=0
82 $DIG +tcp cname.sub.example.org @10.53.0.1 a -p 5300 > dig.out || ret=1
83 grep "status: NOERROR" dig.out > /dev/null || ret=1
84 if [ $ret != 0 ]; then echo "I:failed"; fi
85 status=`expr $status + $ret`
87 echo "I:checking DNAME target filtering (deny)"
88 ret=0
89 $DIG +tcp foo.baddname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
90 grep "status: SERVFAIL" dig.out > /dev/null || ret=1
91 if [ $ret != 0 ]; then echo "I:failed"; fi
92 status=`expr $status + $ret`
94 echo "I:checking DNAME target filtering (accept)"
95 ret=0
96 $DIG +tcp foo.gooddname.example.net @10.53.0.1 a -p 5300 > dig.out || ret=1
97 grep "status: NOERROR" dig.out > /dev/null || ret=1
98 if [ $ret != 0 ]; then echo "I:failed"; fi
99 status=`expr $status + $ret`
101 echo "I:checking DNAME target filtering (accept due to subdomain)"
102 ret=0
103 $DIG +tcp www.dname.sub.example.org @10.53.0.1 a -p 5300 > dig.out || ret=1
104 grep "status: NOERROR" dig.out > /dev/null || ret=1
105 if [ $ret != 0 ]; then echo "I:failed"; fi
106 status=`expr $status + $ret`
108 echo "I:exit status: $status"
109 exit $status