No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / zonechecks / tests.sh
blobcbd48ceca164d5167b6091b837079bad94c90a85
1 #!/bin/sh
3 # Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id: tests.sh,v 1.6 2009/12/04 22:06:37 tbox Exp
19 SYSTEMTESTTOP=..
20 . $SYSTEMTESTTOP/conf.sh
22 status=0
25 echo "I: checking that we detect a NS which refers to a CNAME"
26 if $CHECKZONE . cname.db > cname.out 2>&1
27 then
28 echo "I:failed (status)"; status=1
29 else
30 if grep "is a CNAME" cname.out > /dev/null
31 then
33 else
34 echo "I:failed (message)"; status=1
39 echo "I: checking that we detect a NS which is below a DNAME"
40 if $CHECKZONE . dname.db > dname.out 2>&1
41 then
42 echo "I:failed (status)"; status=1
43 else
44 if grep "is below a DNAME" dname.out > /dev/null
45 then
47 else
48 echo "I:failed (message)"; status=1
53 echo "I: checking that we detect a NS which has no address records (A/AAAA)"
54 if $CHECKZONE . noaddress.db > noaddress.out
55 then
56 echo "I:failed (status)"; status=1
57 else
58 if grep "has no address records" noaddress.out > /dev/null
59 then
61 else
62 echo "I:failed (message)"; status=1
67 echo "I: checking that we detect a NS which has no records"
68 if $CHECKZONE . nxdomain.db > nxdomain.out
69 then
70 echo "I:failed (status)"; status=1
71 else
72 if grep "has no address records" noaddress.out > /dev/null
73 then
75 else
76 echo "I:failed (message)"; status=1
81 echo "I: checking that we detect a NS which looks like a A record (fail)"
82 if $CHECKZONE -n fail . a.db > a.out 2>&1
83 then
84 echo "I:failed (status)"; status=1
85 else
86 if grep "appears to be an address" a.out > /dev/null
87 then
89 else
90 echo "I:failed (message)"; status=1
95 echo "I: checking that we detect a NS which looks like a A record (warn=default)"
96 if $CHECKZONE . a.db > a.out 2>&1
97 then
98 if grep "appears to be an address" a.out > /dev/null
99 then
101 else
102 echo "I:failed (message)"; status=1
104 else
105 echo "I:failed (status)"; status=1
109 echo "I: checking that we detect a NS which looks like a A record (ignore)"
110 if $CHECKZONE -n ignore . a.db > a.out 2>&1
111 then
112 if grep "appears to be an address" a.out > /dev/null
113 then
114 echo "I:failed (message)"; status=1
115 else
118 else
119 echo "I:failed (status)"; status=1
123 echo "I: checking that we detect a NS which looks like a AAAA record (fail)"
124 if $CHECKZONE -n fail . aaaa.db > aaaa.out 2>&1
125 then
126 echo "I:failed (status)"; status=1
127 else
128 if grep "appears to be an address" aaaa.out > /dev/null
129 then
131 else
132 echo "I:failed (message)"; status=1
137 echo "I: checking that we detect a NS which looks like a AAAA record (warn=default)"
138 if $CHECKZONE . aaaa.db > aaaa.out 2>&1
139 then
140 if grep "appears to be an address" aaaa.out > /dev/null
141 then
143 else
144 echo "I:failed (message)"; status=1
146 else
147 echo "I:failed (status)"; status=1
151 echo "I: checking that we detect a NS which looks like a AAAA record (ignore)"
152 if $CHECKZONE -n ignore . aaaa.db > aaaa.out 2>&1
153 then
154 if grep "appears to be an address" aaaa.out > /dev/null
155 then
156 echo "I:failed (message)"; status=1
157 else
160 else
161 echo "I:failed (status)"; status=1
163 echo "I:exit status: $status"
164 exit $status