tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#!/bin/sh
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# Copyright (C) 2006-2008, 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# This Source Code Form is subject to the terms of the Mozilla Public
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# License, v. 2.0. If a copy of the MPL was not distributed with this
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian WellingtonSYSTEMTESTTOP=..
8804fd9936acd703073c4a75072852c38738a990Brian Wellington. $SYSTEMTESTTOP/conf.sh
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian WellingtonDIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short +nocookie"
8804fd9936acd703073c4a75072852c38738a990Brian WellingtonDIGCMD="$DIG $DIGOPTS -p 5300"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafsson test_fixed=true
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonelse
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Order 'fixed' disabled at compile time"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington test_fixed=false
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif $test_fixed; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (master)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington ret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.fixed dig.out.fixed.good || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonelse
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed behaves as cyclic when disabled (master)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington ret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington matches=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.fixed dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.fixed dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.0 dig.out.3 && ret=1
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington cmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (master + additional)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (master)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.1 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic2 dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (master)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval match$i=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonfor 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
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondo
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington $DIGCMD @10.53.0.1 random.example > dig.out.random || ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington match=0
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington 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
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington do
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington if [ $match -eq 1 ]; then break; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 0 ]; then ret=1; fi
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondone
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonmatch=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfor 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
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondo
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington eval "match=\`expr \$match + \$match$i\`"
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondone
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonif [ $match -lt 8 ]; then echo ret=1; fi
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonstatus=`expr $status + $ret`
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif $test_fixed; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (slave)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington ret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.fixed dig.out.fixed.good || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington#
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonecho "I: Checking order cyclic (slave + additional)"
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonret=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonmatches=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington if [ $i -le 4 ]; then
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cp dig.out.cyclic dig.out.$j
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington else
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington fi
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondone
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonstatus=`expr $status + $ret`
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington#
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (slave)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic2 dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (slave)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval match$i=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondone
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfor 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
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington match=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington if [ $match -eq 1 ]; then break; fi
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington done
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington if [ $match -eq 0 ]; then ret=1; fi
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondone
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonmatch=0
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonfor 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
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $match -lt 8 ]; then echo ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Shutting down slave"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington(cd ..; $SHELL stop.sh rrsetorder ns2 )
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking for slave's on disk copy of zone"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ ! -f ns2/root.bk ]
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonthen
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I:failed";
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Re-starting slave"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington(cd ..; $SHELL start.sh --noclean rrsetorder ns2 )
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington#
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington#
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington#
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonif $test_fixed; then
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington echo "I: Checking order fixed (slave loaded from disk)"
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington ret=0
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.fixed dig.out.fixed.good || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (slave + additional, loaded from disk)"
368b37b616234fce3d23099eb180f1dd38e1fb62Mark Andrewsret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
b7cd261f2fca2c7138cdc6ae8ee434e9c0031303Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
368b37b616234fce3d23099eb180f1dd38e1fb62Mark Andrewsstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (slave loaded from disk)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic2 dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonstatus=`expr $status + $ret`
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (slave loaded from disk)"
86c3cd20dd2aff4b1c52ce13d8587abd8d2bd16cBrian Wellingtonret=0
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonfor 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
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondo
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington eval match$i=0
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtondone
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington $DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington match=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 1 ]; then break; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 0 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatch=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $match -lt 8 ]; then echo ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif $test_fixed; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (cache)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington ret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.3 fixed.example > dig.out.fixed || ret=1
78838d3e0cd62423c23de5503910e01884d2104bBrian Wellington cmp -s dig.out.fixed dig.out.fixed.good || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington status=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (cache + additional)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# prime acache
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtondo
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington j=`expr $i % 4`
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington $DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington if [ $i -le 4 ]; then
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cp dig.out.cyclic dig.out.$j
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington else
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafsson#
8804fd9936acd703073c4a75072852c38738a990Brian Wellington#
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (cache)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# prime acache
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatches=0
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafssonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington j=`expr $i % 4`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $i -le 4 ]; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cp dig.out.cyclic2 dig.out.$j
8804fd9936acd703073c4a75072852c38738a990Brian Wellington else
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.0 dig.out.1 && ret=1
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtoncmp -s dig.out.0 dig.out.2 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.0 dig.out.3 && ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellingtoncmp -s dig.out.1 dig.out.2 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.1 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoncmp -s dig.out.2 dig.out.3 && ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $matches -ne 16 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (cache)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
b7cd261f2fca2c7138cdc6ae8ee434e9c0031303Brian Wellington eval match$i=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington $DIGCMD @10.53.0.3 random.example > dig.out.random || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington match=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 1 ]; then break; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellington if [ $match -eq 0 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatch=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $match -lt 8 ]; then echo ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking default order no match in rrset-order (random)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonret=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval match$i=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \
f3ca27e9fe307b55e35ea8d7b37351650630e5a3Andreas Gustafsson -p 5300 @10.53.0.4 random.example > dig.out.random|| ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington match=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellington 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellington do
8804fd9936acd703073c4a75072852c38738a990Brian Wellington eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 1 ]; then break; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington done
8804fd9936acd703073c4a75072852c38738a990Brian Wellington if [ $match -eq 0 ]; then ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonmatch=0
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor 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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondo
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtondone
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $match -lt 8 ]; then echo ret=1; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif [ $ret != 0 ]; then echo "I:failed"; fi
8804fd9936acd703073c4a75072852c38738a990Brian Wellington
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonstatus=`expr $status + $ret`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I:exit status: $status"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington[ $status -eq 0 ] || exit 1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington