d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#!/bin/sh
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
dce54b9b5cfa450570fe9c11644450aeb3ee89f3Tinderbox User# Copyright (C) 2006-2008, 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark AndrewsSYSTEMTESTTOP=..
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews. $SYSTEMTESTTOP/conf.sh
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
68116c5a5fd36fef812fc207de3b7714db2994d5Evan HuntDIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short +nocookie"
68116c5a5fd36fef812fc207de3b7714db2994d5Evan HuntDIGCMD="$DIG $DIGOPTS -p 5300"
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
95de316a5d99b09804eda3223d1a41623d7ed611Evan Huntif grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt test_fixed=true
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntelse
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt echo "I: Order 'fixed' disabled at compile time"
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt test_fixed=false
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntfi
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntif $test_fixed; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt echo "I: Checking order fixed (master)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt ret=0
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt do
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.fixed dig.out.fixed.good >/dev/null || ret=1
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt done
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt if [ $ret != 0 ]; then echo "I:failed"; fi
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt status=`expr $status + $ret`
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Huntelse
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt echo "I: Checking order fixed behaves as cyclic when disabled (master)"
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt ret=0
ab6fd5e89266a29efdafee3784d2cb06f8624b1bMark Andrews matches=0
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt do
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt if [ $i -le 4 ]; then
ab6fd5e89266a29efdafee3784d2cb06f8624b1bMark Andrews cp dig.out.fixed dig.out.$j
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.fixed dig.out.$j >/dev/null && matches=`expr $matches + 1`
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt fi
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt done
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt if [ $matches -ne 16 ]; then ret=1; fi
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt if [ $ret != 0 ]; then echo "I:failed"; fi
89740699cd2191d9b84e67716c281b2dfeba5e56Evan Hunt status=`expr $status + $ret`
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntfi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (master + additional)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntstatus=`expr $status + $ret`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (master)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.1 cyclic2.example > dig.out.cyclic2 || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic2 dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order random (master)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews eval match$i=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.1 random.example > dig.out.random || ret=1
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews match=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews do
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 1 ]; then break; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews done
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 0 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsmatch=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews eval "match=\`expr \$match + \$match$i\`"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Random selection return $match of 24 possible orders in 36 samples"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $match -lt 8 ]; then echo ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntif $test_fixed; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt echo "I: Checking order fixed (slave)"
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt ret=0
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt do
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.fixed dig.out.fixed.good || ret=1
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt done
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt if [ $ret != 0 ]; then echo "I:failed"; fi
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt status=`expr $status + $ret`
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntfi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (slave + additional)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntstatus=`expr $status + $ret`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (slave)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic2 dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order random (slave)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews eval match$i=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt$DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews match=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews do
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 1 ]; then break; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews done
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 0 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsmatch=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewseval "match=\`expr \$match + \$match$i\`"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Random selection return $match of 24 possible orders in 36 samples"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $match -lt 8 ]; then echo ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Shutting down slave"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
60988462e5d6db53205851d056e3482a29239be9Evan Hunt(cd ..; $SHELL stop.sh rrsetorder ns2 )
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking for slave's on disk copy of zone"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ ! -f ns2/root.bk ]
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsthen
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews echo "I:failed";
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews status=`expr $status + 1`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Re-starting slave"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
60988462e5d6db53205851d056e3482a29239be9Evan Hunt(cd ..; $SHELL start.sh --noclean rrsetorder ns2 )
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntif $test_fixed; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt echo "I: Checking order fixed (slave loaded from disk)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt ret=0
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt do
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.fixed dig.out.fixed.good || ret=1
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt done
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt if [ $ret != 0 ]; then echo "I:failed"; fi
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt status=`expr $status + $ret`
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntfi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (slave + additional, loaded from disk)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntstatus=`expr $status + $ret`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (slave loaded from disk)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic2 dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order random (slave loaded from disk)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews eval match$i=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews match=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews do
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 1 ]; then break; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews done
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 0 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsmatch=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewseval "match=\`expr \$match + \$match$i\`"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Random selection return $match of 24 possible orders in 36 samples"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $match -lt 8 ]; then echo ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntif $test_fixed; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt echo "I: Checking order fixed (cache)"
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt ret=0
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt do
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.3 fixed.example > dig.out.fixed || ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.fixed dig.out.fixed.good || ret=1
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt done
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt if [ $ret != 0 ]; then echo "I:failed"; fi
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Hunt status=`expr $status + $ret`
66e50468dde42a9757ac489e738d8b2db8fd7f80Evan Huntfi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (cache + additional)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt# prime acache
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt$DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntstatus=`expr $status + $ret`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt#
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order cyclic (cache)"
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntret=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt# prime acache
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt$DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntmatches=0
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6643b0dd91249ace16218ef667967c87b291992cMark Andrewsdo
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt j=`expr $i % 4`
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt if [ $i -le 4 ]; then
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt cp dig.out.cyclic2 dig.out.$j
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt else
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki $DIFF dig.out.cyclic2 dig.out.$j >/dev/null && matches=`expr $matches + 1`
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Hunt fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.1 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.0 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntif [ $matches -ne 16 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
56c9fcf07580457442b80ac32bdb7c07aa0df870Evan Huntecho "I: Checking order random (cache)"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsret=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews eval match$i=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
68116c5a5fd36fef812fc207de3b7714db2994d5Evan Hunt $DIGCMD @10.53.0.3 random.example > dig.out.random || ret=1
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews match=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews do
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 1 ]; then break; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews done
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews if [ $match -eq 0 ]; then ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsmatch=0
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsfor 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
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdo
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewseval "match=\`expr \$match + \$match$i\`"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsdone
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I: Random selection return $match of 24 possible orders in 36 samples"
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $match -lt 8 ]; then echo ret=1; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrews
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsecho "I: Checking default order no match in rrset-order (random)"
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsret=0
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsfor 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
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdo
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews eval match$i=0
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdone
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsfor 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
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdo
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews -p 5300 @10.53.0.4 random.example > dig.out.random|| ret=1
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews match=0
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews 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
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews do
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews if [ $match -eq 1 ]; then break; fi
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews done
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews if [ $match -eq 0 ]; then ret=1; fi
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdone
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsmatch=0
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsfor 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
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdo
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewseval "match=\`expr \$match + \$match$i\`"
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsdone
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsecho "I: Random selection return $match of 24 possible orders in 36 samples"
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsif [ $match -lt 8 ]; then echo ret=1; fi
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrewsif [ $ret != 0 ]; then echo "I:failed"; fi
9b956d342e93ab60d5d9367785b26546f7e49391Mark Andrews
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsstatus=`expr $status + $ret`
d76ed813a51465e5c47d521ab09ea20c06f1428dMark Andrewsecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1