3 # Copyright (C) 2006-2008, 2011, 2012, 2014 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.
18 .
$SYSTEMTESTTOP/conf.sh
22 if grep "^#define DNS_RDATASET_FIXED" $TOP/config.h
> /dev
/null
2>&1 ; then
25 echo "I: Order 'fixed' disabled at compile time"
33 echo "I: Checking order fixed (master)"
35 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
37 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
38 -p 5300 @
10.53.0.1 fixed.example
> dig.out.fixed || ret
=1
39 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
41 if [ $ret != 0 ]; then echo "I:failed"; fi
42 status
=`expr $status + $ret`
44 echo "I: Checking order fixed behaves as cyclic when disabled (master)"
47 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
50 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
51 -p 5300 @
10.53.0.1 fixed.example
> dig.out.fixed || ret
=1
53 cp dig.out.fixed
dig.out.
$j
55 cmp -s dig.out.fixed
dig.out.
$j && matches
=`expr $matches + 1`
58 cmp -s dig.out
.0 dig.out
.1 && ret
=1
59 cmp -s dig.out
.0 dig.out
.2 && ret
=1
60 cmp -s dig.out
.0 dig.out
.3 && ret
=1
61 cmp -s dig.out
.1 dig.out
.2 && ret
=1
62 cmp -s dig.out
.1 dig.out
.3 && ret
=1
63 cmp -s dig.out
.2 dig.out
.3 && ret
=1
64 if [ $matches -ne 16 ]; then ret
=1; fi
65 if [ $ret != 0 ]; then echo "I:failed"; fi
66 status
=`expr $status + $ret`
72 echo "I: Checking order cyclic (master + additional)"
75 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
78 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
79 -p 5300 @
10.53.0.1 cyclic.example
> dig.out.cyclic || ret
=1
81 cp dig.out.cyclic
dig.out.
$j
83 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
86 cmp -s dig.out
.0 dig.out
.1 && ret
=1
87 cmp -s dig.out
.0 dig.out
.2 && ret
=1
88 cmp -s dig.out
.0 dig.out
.3 && ret
=1
89 cmp -s dig.out
.1 dig.out
.2 && ret
=1
90 cmp -s dig.out
.1 dig.out
.3 && ret
=1
91 cmp -s dig.out
.2 dig.out
.3 && ret
=1
92 if [ $matches -ne 16 ]; then ret
=1; fi
93 if [ $ret != 0 ]; then echo "I:failed"; fi
94 status
=`expr $status + $ret`
99 echo "I: Checking order cyclic (master)"
102 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
105 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
106 -p 5300 @
10.53.0.1 cyclic2.example
> dig.out.cyclic2 || ret
=1
107 if [ $i -le 4 ]; then
108 cp dig.out.cyclic2
dig.out.
$j
110 cmp -s dig.out.cyclic2
dig.out.
$j && matches
=`expr $matches + 1`
113 cmp -s dig.out
.0 dig.out
.1 && ret
=1
114 cmp -s dig.out
.0 dig.out
.2 && ret
=1
115 cmp -s dig.out
.0 dig.out
.3 && ret
=1
116 cmp -s dig.out
.1 dig.out
.2 && ret
=1
117 cmp -s dig.out
.1 dig.out
.3 && ret
=1
118 cmp -s dig.out
.2 dig.out
.3 && ret
=1
119 if [ $matches -ne 16 ]; then ret
=1; fi
120 if [ $ret != 0 ]; then echo "I:failed"; fi
121 status
=`expr $status + $ret`
122 echo "I: Checking order random (master)"
124 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
128 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
130 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
131 -p 5300 @
10.53.0.1 random.example
> dig.out.random || ret
=1
133 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
135 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
136 if [ $match -eq 1 ]; then break; fi
138 if [ $match -eq 0 ]; then ret
=1; fi
141 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
143 eval "match=\`expr \$match + \$match$i\`"
145 echo "I: Random selection return $match of 24 possible orders in 36 samples"
146 if [ $match -lt 8 ]; then echo ret
=1; fi
147 if [ $ret != 0 ]; then echo "I:failed"; fi
148 status
=`expr $status + $ret`
154 echo "I: Checking order fixed (slave)"
156 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
158 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
159 -p 5300 @
10.53.0.2 fixed.example
> dig.out.fixed || ret
=1
160 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
162 if [ $ret != 0 ]; then echo "I:failed"; fi
163 status
=`expr $status + $ret`
169 echo "I: Checking order cyclic (slave + additional)"
172 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
175 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
176 -p 5300 @
10.53.0.2 cyclic.example
> dig.out.cyclic || ret
=1
177 if [ $i -le 4 ]; then
178 cp dig.out.cyclic
dig.out.
$j
180 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
183 cmp -s dig.out
.0 dig.out
.1 && ret
=1
184 cmp -s dig.out
.0 dig.out
.2 && ret
=1
185 cmp -s dig.out
.0 dig.out
.3 && ret
=1
186 cmp -s dig.out
.1 dig.out
.2 && ret
=1
187 cmp -s dig.out
.1 dig.out
.3 && ret
=1
188 cmp -s dig.out
.2 dig.out
.3 && ret
=1
189 if [ $matches -ne 16 ]; then ret
=1; fi
190 if [ $ret != 0 ]; then echo "I:failed"; fi
191 status
=`expr $status + $ret`
196 echo "I: Checking order cyclic (slave)"
199 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
202 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
203 -p 5300 @
10.53.0.2 cyclic2.example
> dig.out.cyclic2 || ret
=1
204 if [ $i -le 4 ]; then
205 cp dig.out.cyclic2
dig.out.
$j
207 cmp -s dig.out.cyclic2
dig.out.
$j && matches
=`expr $matches + 1`
210 cmp -s dig.out
.0 dig.out
.1 && ret
=1
211 cmp -s dig.out
.0 dig.out
.2 && ret
=1
212 cmp -s dig.out
.0 dig.out
.3 && ret
=1
213 cmp -s dig.out
.1 dig.out
.2 && ret
=1
214 cmp -s dig.out
.1 dig.out
.3 && ret
=1
215 cmp -s dig.out
.2 dig.out
.3 && ret
=1
216 if [ $matches -ne 16 ]; then ret
=1; fi
217 if [ $ret != 0 ]; then echo "I:failed"; fi
218 status
=`expr $status + $ret`
220 echo "I: Checking order random (slave)"
222 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
226 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
228 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
229 -p 5300 @
10.53.0.2 random.example
> dig.out.random || ret
=1
231 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
233 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
234 if [ $match -eq 1 ]; then break; fi
236 if [ $match -eq 0 ]; then ret
=1; fi
239 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
241 eval "match=\`expr \$match + \$match$i\`"
243 echo "I: Random selection return $match of 24 possible orders in 36 samples"
244 if [ $match -lt 8 ]; then echo ret
=1; fi
245 if [ $ret != 0 ]; then echo "I:failed"; fi
246 status
=`expr $status + $ret`
248 echo "I: Shutting down slave"
250 (cd ..
; $SHELL stop.sh rrsetorder ns2
)
252 echo "I: Checking for slave's on disk copy of zone"
254 if [ ! -f ns
2/root.bk
]
257 status
=`expr $status + 1`
260 echo "I: Re-starting slave"
262 (cd ..
; $SHELL start.sh
--noclean rrsetorder ns2
)
268 echo "I: Checking order fixed (slave loaded from disk)"
270 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
272 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
273 -p 5300 @
10.53.0.2 fixed.example
> dig.out.fixed || ret
=1
274 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
276 if [ $ret != 0 ]; then echo "I:failed"; fi
277 status
=`expr $status + $ret`
283 echo "I: Checking order cyclic (slave + additional, loaded from disk)"
286 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
289 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
290 -p 5300 @
10.53.0.2 cyclic.example
> dig.out.cyclic || ret
=1
291 if [ $i -le 4 ]; then
292 cp dig.out.cyclic
dig.out.
$j
294 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
297 cmp -s dig.out
.0 dig.out
.1 && ret
=1
298 cmp -s dig.out
.0 dig.out
.2 && ret
=1
299 cmp -s dig.out
.0 dig.out
.3 && ret
=1
300 cmp -s dig.out
.1 dig.out
.2 && ret
=1
301 cmp -s dig.out
.1 dig.out
.3 && ret
=1
302 cmp -s dig.out
.2 dig.out
.3 && ret
=1
303 if [ $matches -ne 16 ]; then ret
=1; fi
304 if [ $ret != 0 ]; then echo "I:failed"; fi
305 status
=`expr $status + $ret`
310 echo "I: Checking order cyclic (slave loaded from disk)"
313 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
316 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
317 -p 5300 @
10.53.0.2 cyclic2.example
> dig.out.cyclic2 || ret
=1
318 if [ $i -le 4 ]; then
319 cp dig.out.cyclic2
dig.out.
$j
321 cmp -s dig.out.cyclic2
dig.out.
$j && matches
=`expr $matches + 1`
324 cmp -s dig.out
.0 dig.out
.1 && ret
=1
325 cmp -s dig.out
.0 dig.out
.2 && ret
=1
326 cmp -s dig.out
.0 dig.out
.3 && ret
=1
327 cmp -s dig.out
.1 dig.out
.2 && ret
=1
328 cmp -s dig.out
.1 dig.out
.3 && ret
=1
329 cmp -s dig.out
.2 dig.out
.3 && ret
=1
330 if [ $matches -ne 16 ]; then ret
=1; fi
331 if [ $ret != 0 ]; then echo "I:failed"; fi
332 status
=`expr $status + $ret`
334 echo "I: Checking order random (slave loaded from disk)"
336 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
340 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
342 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
343 -p 5300 @
10.53.0.2 random.example
> dig.out.random || ret
=1
345 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
347 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
348 if [ $match -eq 1 ]; then break; fi
350 if [ $match -eq 0 ]; then ret
=1; fi
353 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
355 eval "match=\`expr \$match + \$match$i\`"
357 echo "I: Random selection return $match of 24 possible orders in 36 samples"
358 if [ $match -lt 8 ]; then echo ret
=1; fi
359 if [ $ret != 0 ]; then echo "I:failed"; fi
360 status
=`expr $status + $ret`
366 echo "I: Checking order fixed (cache)"
368 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
370 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
371 -p 5300 @
10.53.0.3 fixed.example
> dig.out.fixed || ret
=1
372 cmp -s dig.out.fixed
dig.out.fixed.good || ret
=1
374 if [ $ret != 0 ]; then echo "I:failed"; fi
375 status
=`expr $status + $ret`
381 echo "I: Checking order cyclic (cache + additional)"
384 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
385 -p 5300 @
10.53.0.3 cyclic.example
> dig.out.cyclic || ret
=1
387 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
390 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
391 -p 5300 @
10.53.0.3 cyclic.example
> dig.out.cyclic || ret
=1
392 if [ $i -le 4 ]; then
393 cp dig.out.cyclic
dig.out.
$j
395 cmp -s dig.out.cyclic
dig.out.
$j && matches
=`expr $matches + 1`
398 cmp -s dig.out
.0 dig.out
.1 && ret
=1
399 cmp -s dig.out
.0 dig.out
.2 && ret
=1
400 cmp -s dig.out
.0 dig.out
.3 && ret
=1
401 cmp -s dig.out
.1 dig.out
.2 && ret
=1
402 cmp -s dig.out
.1 dig.out
.3 && ret
=1
403 cmp -s dig.out
.2 dig.out
.3 && ret
=1
404 if [ $matches -ne 16 ]; then ret
=1; fi
405 if [ $ret != 0 ]; then echo "I:failed"; fi
406 status
=`expr $status + $ret`
411 echo "I: Checking order cyclic (cache)"
414 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
415 -p 5300 @
10.53.0.3 cyclic2.example
> dig.out.cyclic2 || ret
=1
417 for i
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
420 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
421 -p 5300 @
10.53.0.3 cyclic2.example
> dig.out.cyclic2 || ret
=1
422 if [ $i -le 4 ]; then
423 cp dig.out.cyclic2
dig.out.
$j
425 cmp -s dig.out.cyclic2
dig.out.
$j && matches
=`expr $matches + 1`
428 cmp -s dig.out
.0 dig.out
.1 && ret
=1
429 cmp -s dig.out
.0 dig.out
.2 && ret
=1
430 cmp -s dig.out
.0 dig.out
.3 && ret
=1
431 cmp -s dig.out
.1 dig.out
.2 && ret
=1
432 cmp -s dig.out
.1 dig.out
.3 && ret
=1
433 cmp -s dig.out
.2 dig.out
.3 && ret
=1
434 if [ $matches -ne 16 ]; then ret
=1; fi
435 if [ $ret != 0 ]; then echo "I:failed"; fi
436 status
=`expr $status + $ret`
438 echo "I: Checking order random (cache)"
440 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
444 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
446 $DIG +nosea
+nocomm
+nocmd
+noquest
+noadd
+noauth
+nocomm
+nostat
+short \
447 -p 5300 @
10.53.0.3 random.example
> dig.out.random || ret
=1
449 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
451 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
452 if [ $match -eq 1 ]; then break; fi
454 if [ $match -eq 0 ]; then ret
=1; fi
457 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
459 eval "match=\`expr \$match + \$match$i\`"
461 echo "I: Random selection return $match of 24 possible orders in 36 samples"
462 if [ $match -lt 8 ]; then echo ret
=1; fi
463 if [ $ret != 0 ]; then echo "I:failed"; fi
465 status
=`expr $status + $ret`
466 echo "I:exit status: $status"