Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / forward / tests.sh
blob08467a6227e0b1fff80a1b8d8889f75a01c43192
1 # Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
2 # Copyright (C) 2000, 2001 Internet Software Consortium.
4 # Permission to use, copy, modify, and/or distribute this software for any
5 # purpose with or without fee is hereby granted, provided that the above
6 # copyright notice and this permission notice appear in all copies.
8 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 # PERFORMANCE OF THIS SOFTWARE.
16 # Id: tests.sh,v 1.7 2007/06/19 23:47:03 tbox Exp
18 SYSTEMTESTTOP=..
19 . $SYSTEMTESTTOP/conf.sh
21 root=10.53.0.1
22 hidden=10.53.0.2
23 f1=10.53.0.3
24 f2=10.53.0.4
26 status=0
28 echo "I:checking that a forward zone overrides global forwarders"
29 ret=0
30 $DIG txt.example1. txt @$hidden -p 5300 > dig.out.hidden || ret=1
31 $DIG txt.example1. txt @$f1 -p 5300 > dig.out.f1 || ret=1
32 $PERL ../digcomp.pl dig.out.hidden dig.out.f1 || ret=1
33 if [ $ret != 0 ]; then echo "I:failed"; fi
34 status=`expr $status + $ret`
36 echo "I:checking that a forward first zone no forwarders recurses"
37 ret=0
38 $DIG txt.example2. txt @$root -p 5300 > dig.out.root || ret=1
39 $DIG txt.example2. txt @$f1 -p 5300 > dig.out.f1 || ret=1
40 $PERL ../digcomp.pl dig.out.root dig.out.f1 || ret=1
41 if [ $ret != 0 ]; then echo "I:failed"; fi
42 status=`expr $status + $ret`
44 echo "I:checking that a forward only zone no forwarders fails"
45 ret=0
46 $DIG txt.example2. txt @$root -p 5300 > dig.out.root || ret=1
47 $DIG txt.example2. txt @$f1 -p 5300 > dig.out.f1 || ret=1
48 $PERL ../digcomp.pl dig.out.root dig.out.f1 || ret=1
49 if [ $ret != 0 ]; then echo "I:failed"; fi
50 status=`expr $status + $ret`
52 echo "I:checking that global forwarders work"
53 ret=0
54 $DIG txt.example4. txt @$hidden -p 5300 > dig.out.hidden || ret=1
55 $DIG txt.example4. txt @$f1 -p 5300 > dig.out.f1 || ret=1
56 $PERL ../digcomp.pl dig.out.hidden dig.out.f1 || ret=1
57 if [ $ret != 0 ]; then echo "I:failed"; fi
58 status=`expr $status + $ret`
60 echo "I:checking that a forward zone works"
61 ret=0
62 $DIG txt.example1. txt @$hidden -p 5300 > dig.out.hidden || ret=1
63 $DIG txt.example1. txt @$f2 -p 5300 > dig.out.f2 || ret=1
64 $PERL ../digcomp.pl dig.out.hidden dig.out.f2 || ret=1
65 if [ $ret != 0 ]; then echo "I:failed"; fi
66 status=`expr $status + $ret`
68 echo "I:checking that forwarding doesn't spontaneously happen"
69 ret=0
70 $DIG txt.example2. txt @$root -p 5300 > dig.out.root || ret=1
71 $DIG txt.example2. txt @$f2 -p 5300 > dig.out.f2 || ret=1
72 $PERL ../digcomp.pl dig.out.root dig.out.f2 || ret=1
73 if [ $ret != 0 ]; then echo "I:failed"; fi
74 status=`expr $status + $ret`
76 echo "I:checking that a forward zone with no specified policy works"
77 ret=0
78 $DIG txt.example3. txt @$hidden -p 5300 > dig.out.hidden || ret=1
79 $DIG txt.example3. txt @$f2 -p 5300 > dig.out.f2 || ret=1
80 $PERL ../digcomp.pl dig.out.hidden dig.out.f2 || ret=1
81 if [ $ret != 0 ]; then echo "I:failed"; fi
82 status=`expr $status + $ret`
84 echo "I:checking that a forward only doesn't recurse"
85 ret=0
86 $DIG txt.example5. txt @$f2 -p 5300 > dig.out.f2 || ret=1
87 grep "SERVFAIL" dig.out.f2 > /dev/null || ret=1
88 if [ $ret != 0 ]; then echo "I:failed"; fi
89 status=`expr $status + $ret`
91 echo "I:exit status: $status"
92 exit $status