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
20 .
$SYSTEMTESTTOP/conf.sh
25 echo "I: checking that we detect a NS which refers to a CNAME"
26 if $CHECKZONE . cname.db
> cname.out
2>&1
28 echo "I:failed (status)"; status
=1
30 if grep "is a CNAME" cname.out
> /dev
/null
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
42 echo "I:failed (status)"; status
=1
44 if grep "is below a DNAME" dname.out
> /dev
/null
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
56 echo "I:failed (status)"; status
=1
58 if grep "has no address records" noaddress.out
> /dev
/null
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
70 echo "I:failed (status)"; status
=1
72 if grep "has no address records" noaddress.out
> /dev
/null
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
84 echo "I:failed (status)"; status
=1
86 if grep "appears to be an address" a.out
> /dev
/null
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
98 if grep "appears to be an address" a.out
> /dev
/null
102 echo "I:failed (message)"; status
=1
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
112 if grep "appears to be an address" a.out
> /dev
/null
114 echo "I:failed (message)"; status
=1
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
126 echo "I:failed (status)"; status
=1
128 if grep "appears to be an address" aaaa.out
> /dev
/null
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
140 if grep "appears to be an address" aaaa.out
> /dev
/null
144 echo "I:failed (message)"; status
=1
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
154 if grep "appears to be an address" aaaa.out
> /dev
/null
156 echo "I:failed (message)"; status
=1
161 echo "I:failed (status)"; status
=1
163 echo "I:exit status: $status"