Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / unknown / tests.sh
blobea5992f4f4de7fc1c875ee9bb16693067de766bb
1 #!/bin/sh
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
20 SYSTEMTESTTOP=..
21 . $SYSTEMTESTTOP/conf.sh
23 status=0
25 DIGOPTS="-p 5300"
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
30 ret=0
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
33 if [ $ret != 0 ]
34 then
35 echo "#$i failed"
37 status=`expr $status + $ret`
38 done
40 echo "I:querying for various representations of an IN TXT record"
41 for i in 1 2 3 4 5 6 7
43 ret=0
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
46 if [ $ret != 0 ]
47 then
48 echo "#$i failed"
50 status=`expr $status + $ret`
51 done
53 echo "I:querying for various representations of an IN TYPE123 record"
54 for i in 1 2 3
56 ret=0
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
59 if [ $ret != 0 ]
60 then
61 echo "#$i failed"
63 status=`expr $status + $ret`
64 done
66 echo "I:querying for NULL record"
67 ret=0
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"
74 ret=0
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"
81 for i in 1 2
83 ret=0
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
86 if [ $ret != 0 ]
87 then
88 echo "#$i failed"
90 status=`expr $status + $ret`
91 done
93 echo "I:querying for various representations of a CLASS10 TXT record"
94 for i in 1 2 3 4
96 ret=0
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
99 if [ $ret != 0 ]
100 then
101 echo "#$i failed"
103 status=`expr $status + $ret`
104 done
106 echo "I:querying for various representations of a CLASS10 TYPE123 record"
107 for i in 1 2
109 ret=0
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
112 if [ $ret != 0 ]
113 then
114 echo "#$i failed"
116 status=`expr $status + $ret`
117 done
119 echo "I:querying for SOAs of zone that should have failed to load"
120 for i in 1 2 3 4
122 ret=0
123 $DIG $DIGOPTS @10.53.0.1 broken$i. soa in > dig.out || ret=1
124 grep "SERVFAIL" dig.out > /dev/null || ret=1
125 if [ $ret != 0 ]
126 then
127 echo "#$i failed"
129 status=`expr $status + $ret`
130 done
132 echo "I:checking large unknown record loading on master"
133 ret=0
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"
140 ret=0
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"
151 ret=0
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"
158 ret=0
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"
169 ret=0
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"
176 ret=0
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"
183 ret=0
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'"
190 ret=0
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"
199 exit $status