3 # Copyright (C) 2004, 2007, 2011-2013 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.12 2011/11/02 23:46:24 tbox Exp
21 .
$SYSTEMTESTTOP/conf.sh
27 echo "I:querying for various representations of an IN A record"
28 for i
in 1 2 3 4 5 6 7 8 9 10 11 12
31 $DIG +short
$DIGOPTS @
10.53.0.1 a
$i.example a
in > dig.out || ret
=1
32 echo 10.0.0.1 |
diff - dig.out || ret
=1
37 status
=`expr $status + $ret`
40 echo "I:querying for various representations of an IN TXT record"
41 for i
in 1 2 3 4 5 6 7
44 $DIG +short
$DIGOPTS @
10.53.0.1 txt
$i.example txt
in > dig.out || ret
=1
45 echo '"hello"' |
diff - dig.out || ret
=1
50 status
=`expr $status + $ret`
53 echo "I:querying for various representations of an IN TYPE123 record"
57 $DIG +short
$DIGOPTS @
10.53.0.1 unk
$i.example type123
in > dig.out || ret
=1
58 echo '\# 1 00' |
diff - dig.out || ret
=1
63 status
=`expr $status + $ret`
66 echo "I:querying for NULL record"
68 $DIG +short
$DIGOPTS @
10.53.0.1 null.example null
in > dig.out || ret
=1
69 echo '\# 1 00' |
diff - dig.out || ret
=1
70 [ $ret = 0 ] ||
echo "I: failed"
71 status
=`expr $status + $ret`
73 echo "I:querying for empty NULL record"
75 $DIG +short
$DIGOPTS @
10.53.0.1 empty.example null
in > dig.out || ret
=1
76 echo '\# 0' |
diff - dig.out || ret
=1
77 [ $ret = 0 ] ||
echo "I: failed"
78 status
=`expr $status + $ret`
80 echo "I:querying for various representations of a CLASS10 TYPE1 record"
84 $DIG +short
$DIGOPTS @
10.53.0.1 a
$i.example a class10
> dig.out || ret
=1
85 echo '\# 4 0A000001' |
diff - dig.out || ret
=1
90 status
=`expr $status + $ret`
93 echo "I:querying for various representations of a CLASS10 TXT record"
97 $DIG +short
$DIGOPTS @
10.53.0.1 txt
$i.example txt class10
> dig.out || ret
=1
98 echo '"hello"' |
diff - dig.out || ret
=1
103 status
=`expr $status + $ret`
106 echo "I:querying for various representations of a CLASS10 TYPE123 record"
110 $DIG +short
$DIGOPTS @
10.53.0.1 unk
$i.example type123 class10
> dig.out || ret
=1
111 echo '\# 1 00' |
diff - dig.out || ret
=1
116 status
=`expr $status + $ret`
119 echo "I:querying for SOAs of zone that should have failed to load"
123 $DIG $DIGOPTS @
10.53.0.1 broken
$i. soa
in > dig.out || ret
=1
124 grep "SERVFAIL" dig.out
> /dev
/null || ret
=1
129 status
=`expr $status + $ret`
132 echo "I:checking large unknown record loading on master"
134 $DIG $DIGOPTS @
10.53.0.1 +tcp
+short large.example TYPE45234
> dig.out ||
{ ret
=1 ; echo I
: dig failed
; }
135 diff -s large.out
dig.out
> /dev
/null ||
{ ret
=1 ; echo "I: diff failed"; }
136 [ $ret = 0 ] ||
echo "I: failed"
137 status
=`expr $status + $ret`
139 echo "I:checking large unknown record loading on slave"
141 $DIG $DIGOPTS @
10.53.0.2 +tcp
+short large.example TYPE45234
> dig.out ||
{ ret
=1 ; echo I
: dig failed
; }
142 diff -s large.out
dig.out
> /dev
/null ||
{ ret
=1 ; echo "I: diff failed"; }
143 [ $ret = 0 ] ||
echo "I: failed"
144 status
=`expr $status + $ret`
146 echo "I:stop and restart slave"
147 $PERL $SYSTEMTESTTOP/stop.pl . ns2
148 $PERL $SYSTEMTESTTOP/start.pl
--noclean --restart . ns2
150 echo "I:checking large unknown record loading on slave"
152 $DIG $DIGOPTS @
10.53.0.2 +tcp
+short large.example TYPE45234
> dig.out ||
{ ret
=1 ; echo I
: dig failed
; }
153 diff -s large.out
dig.out
> /dev
/null ||
{ ret
=1 ; echo "I: diff failed"; }
154 [ $ret = 0 ] ||
echo "I: failed"
155 status
=`expr $status + $ret`
157 echo "I:checking large unknown record loading on inline slave"
159 $DIG $DIGOPTS @
10.53.0.3 +tcp
+short large.example TYPE45234
> dig.out ||
{ ret
=1 ; echo I
: dig failed
; }
160 diff large.out
dig.out
> /dev
/null ||
{ ret
=1 ; echo "I: diff failed"; }
161 [ $ret = 0 ] ||
echo "I: failed"
162 status
=`expr $status + $ret`
164 echo "I:stop and restart inline slave"
165 $PERL $SYSTEMTESTTOP/stop.pl . ns3
166 $PERL $SYSTEMTESTTOP/start.pl
--noclean --restart . ns3
168 echo "I:checking large unknown record loading on inline slave"
170 $DIG $DIGOPTS @
10.53.0.3 +tcp
+short large.example TYPE45234
> dig.out ||
{ ret
=1 ; echo I
: dig failed
; }
171 diff large.out
dig.out
> /dev
/null ||
{ ret
=1 ; echo "I: diff failed"; }
172 [ $ret = 0 ] ||
echo "I: failed"
173 status
=`expr $status + $ret`
175 echo "I:check that '"'"\\#"'"' is not treated as the unknown escape sequence"
177 $DIG $DIGOPTS @
10.53.0.1 +tcp
+short txt8.example txt
> dig.out
178 echo '"#" "2" "0145"' |
diff - dig.out || ret
=1
179 [ $ret = 0 ] ||
echo "I: failed"
180 status
=`expr $status + $ret`
182 echo "I:check that 'TXT \# text' is not treated as the unknown escape sequence"
184 $DIG $DIGOPTS @
10.53.0.1 +tcp
+short txt9.example txt
> dig.out
185 echo '"#" "text"' |
diff - dig.out || ret
=1
186 [ $ret = 0 ] ||
echo "I: failed"
187 status
=`expr $status + $ret`
189 echo "I:check that 'TYPE353 \# cat' produces 'not a valid number'"
191 $CHECKZONE nan.bad zones
/nan.bad
> check.out
2>&1
192 grep "not a valid number" check.out
> /dev
/null || ret
=1
193 [ $ret = 0 ] ||
echo "I: failed"
194 status
=`expr $status + $ret`
198 echo "I:exit status: $status"