3 # Copyright (C) 2006-2008 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.8 2008/10/09 21:27:52 each Exp
20 .
$SYSTEMTESTTOP/conf.sh
24 if grep "^#define DNS_RDATASET_FIXED" $TOP/config.h
> /dev
/null
2>&1 ; then
27 echo "I: Order 'fixed' disabled at compile time"
35 echo "I: Checking order fixed (master)"
37 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
39 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
40 -p 5300 @
10.53.0.1 fixed.example
> dig.out.fixed || ret
=1
41 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
43 if [ $ret != 0 ]; then echo "I:failed"; fi
44 status
=`expr $status + $ret`
50 echo "I: Checking order cyclic (master)"
53 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
56 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
57 -p 5300 @
10.53.0.1 cyclic.example
> dig.out.cyclic || ret
=1
59 cp dig.out.cyclic
dig.out.
$j
61 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
64 cmp -s dig.out
.0 dig.out
.1 && ret
=1
65 cmp -s dig.out
.0 dig.out
.2 && ret
=1
66 cmp -s dig.out
.0 dig.out
.3 && ret
=1
67 cmp -s dig.out
.1 dig.out
.2 && ret
=1
68 cmp -s dig.out
.1 dig.out
.3 && ret
=1
69 cmp -s dig.out
.2 dig.out
.3 && ret
=1
70 if [ $matches -ne 16 ]; then ret
=1; fi
71 if [ $ret != 0 ]; then echo "I:failed"; fi
72 status
=`expr $status + $ret`
74 echo "I: Checking order random (master)"
76 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
80 for i
in a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 9
82 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
83 -p 5300 @
10.53.0.1 random.example
> dig.out.random || ret
=1
85 for j
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
87 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
88 if [ $match -eq 1 ]; then break; fi
90 if [ $match -eq 0 ]; then ret
=1; fi
93 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
95 eval "match=\`expr \$match + \$match$i\`"
97 echo "I: Random selection return $match of 24 possible orders in 36 samples"
98 if [ $match -lt 8 ]; then echo ret
=1; fi
99 if [ $ret != 0 ]; then echo "I:failed"; fi
100 status
=`expr $status + $ret`
106 echo "I: Checking order fixed (slave)"
108 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
110 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
111 -p 5300 @
10.53.0.2 fixed.example
> dig.out.fixed || ret
=1
112 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
114 if [ $ret != 0 ]; then echo "I:failed"; fi
115 status
=`expr $status + $ret`
121 echo "I: Checking order cyclic (slave)"
124 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
127 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
128 -p 5300 @
10.53.0.2 cyclic.example
> dig.out.cyclic || ret
=1
129 if [ $i -le 4 ]; then
130 cp dig.out.cyclic
dig.out.
$j
132 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
135 cmp -s dig.out
.0 dig.out
.1 && ret
=1
136 cmp -s dig.out
.0 dig.out
.2 && ret
=1
137 cmp -s dig.out
.0 dig.out
.3 && ret
=1
138 cmp -s dig.out
.1 dig.out
.2 && ret
=1
139 cmp -s dig.out
.1 dig.out
.3 && ret
=1
140 cmp -s dig.out
.2 dig.out
.3 && ret
=1
141 if [ $matches -ne 16 ]; then ret
=1; fi
142 if [ $ret != 0 ]; then echo "I:failed"; fi
143 status
=`expr $status + $ret`
145 echo "I: Checking order random (slave)"
147 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
151 for i
in a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 9
153 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
154 -p 5300 @
10.53.0.2 random.example
> dig.out.random || ret
=1
156 for j
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
158 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
159 if [ $match -eq 1 ]; then break; fi
161 if [ $match -eq 0 ]; then ret
=1; fi
164 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
166 eval "match=\`expr \$match + \$match$i\`"
168 echo "I: Random selection return $match of 24 possible orders in 36 samples"
169 if [ $match -lt 8 ]; then echo ret
=1; fi
170 if [ $ret != 0 ]; then echo "I:failed"; fi
171 status
=`expr $status + $ret`
173 echo "I: Shutting down slave"
175 (cd ..
; sh stop.sh rrsetorder ns2
)
177 echo "I: Checking for slave's on disk copy of zone"
179 if [ ! -f ns
2/root.bk
]
182 status
=`expr $status + 1`
185 echo "I: Re-starting slave"
187 (cd ..
; sh start.sh
--noclean rrsetorder ns2
)
193 echo "I: Checking order fixed (slave loaded from disk)"
195 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
197 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
198 -p 5300 @
10.53.0.2 fixed.example
> dig.out.fixed || ret
=1
199 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
201 if [ $ret != 0 ]; then echo "I:failed"; fi
202 status
=`expr $status + $ret`
208 echo "I: Checking order cyclic (slave loaded from disk)"
211 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
214 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
215 -p 5300 @
10.53.0.2 cyclic.example
> dig.out.cyclic || ret
=1
216 if [ $i -le 4 ]; then
217 cp dig.out.cyclic
dig.out.
$j
219 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
222 cmp -s dig.out
.0 dig.out
.1 && ret
=1
223 cmp -s dig.out
.0 dig.out
.2 && ret
=1
224 cmp -s dig.out
.0 dig.out
.3 && ret
=1
225 cmp -s dig.out
.1 dig.out
.2 && ret
=1
226 cmp -s dig.out
.1 dig.out
.3 && ret
=1
227 cmp -s dig.out
.2 dig.out
.3 && ret
=1
228 if [ $matches -ne 16 ]; then ret
=1; fi
229 if [ $ret != 0 ]; then echo "I:failed"; fi
230 status
=`expr $status + $ret`
232 echo "I: Checking order random (slave loaded from disk)"
234 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
238 for i
in a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 9
240 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
241 -p 5300 @
10.53.0.2 random.example
> dig.out.random || ret
=1
243 for j
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
245 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
246 if [ $match -eq 1 ]; then break; fi
248 if [ $match -eq 0 ]; then ret
=1; fi
251 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
253 eval "match=\`expr \$match + \$match$i\`"
255 echo "I: Random selection return $match of 24 possible orders in 36 samples"
256 if [ $match -lt 8 ]; then echo ret
=1; fi
257 if [ $ret != 0 ]; then echo "I:failed"; fi
258 status
=`expr $status + $ret`
264 echo "I: Checking order fixed (cache)"
266 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
268 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
269 -p 5300 @
10.53.0.3 fixed.example
> dig.out.fixed || ret
=1
270 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
272 if [ $ret != 0 ]; then echo "I:failed"; fi
273 status
=`expr $status + $ret`
279 echo "I: Checking order cyclic (cache)"
282 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
285 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
286 -p 5300 @
10.53.0.3 cyclic.example
> dig.out.cyclic || ret
=1
287 if [ $i -le 4 ]; then
288 cp dig.out.cyclic
dig.out.
$j
290 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
293 cmp -s dig.out
.0 dig.out
.1 && ret
=1
294 cmp -s dig.out
.0 dig.out
.2 && ret
=1
295 cmp -s dig.out
.0 dig.out
.3 && ret
=1
296 cmp -s dig.out
.1 dig.out
.2 && ret
=1
297 cmp -s dig.out
.1 dig.out
.3 && ret
=1
298 cmp -s dig.out
.2 dig.out
.3 && ret
=1
299 if [ $matches -ne 16 ]; then ret
=1; fi
300 if [ $ret != 0 ]; then echo "I:failed"; fi
301 status
=`expr $status + $ret`
303 echo "I: Checking order random (cache)"
305 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
309 for i
in a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 9
311 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
312 -p 5300 @
10.53.0.3 random.example
> dig.out.random || ret
=1
314 for j
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
316 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
317 if [ $match -eq 1 ]; then break; fi
319 if [ $match -eq 0 ]; then ret
=1; fi
322 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
324 eval "match=\`expr \$match + \$match$i\`"
326 echo "I: Random selection return $match of 24 possible orders in 36 samples"
327 if [ $match -lt 8 ]; then echo ret
=1; fi
328 if [ $ret != 0 ]; then echo "I:failed"; fi
330 status
=`expr $status + $ret`
331 echo "I:exit status: $status"