tests.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# Copyright (C) 2006-2008, 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
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 WellingtonDIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short +nocookie"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonif grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Order 'fixed' disabled at compile time"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (master)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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 echo "I: Checking order fixed behaves as cyclic when disabled (master)"
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 $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.fixed dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (master + additional)"
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 Wellington $DIGCMD @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (master)"
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 Wellington $DIGCMD @10.53.0.1 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (master)"
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
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 Wellington $DIGCMD @10.53.0.1 random.example > dig.out.random || ret=1
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 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
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 Wellington eval "match=\`expr \$match + \$match$i\`"
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (slave)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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
e3e3bafa138a20558a2253470effc01702fc6dfdBrian Wellingtonecho "I: Checking order cyclic (slave + additional)"
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 Wellington $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (slave)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonfor i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
c03bb27f0675a6e60ceea66b451548e8481bc05cMark Andrews $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (slave)"
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
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
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
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 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
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
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Shutting down slave"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking for slave's on disk copy of zone"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I:failed";
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Re-starting slave"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington(cd ..; $SHELL start.sh --noclean rrsetorder ns2 )
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington echo "I: Checking order fixed (slave loaded from disk)"
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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 Wellingtonecho "I: Checking order cyclic (slave + additional, loaded from disk)"
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 Wellington $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (slave loaded from disk)"
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 Wellington $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (slave loaded from disk)"
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 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 Wellington $DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
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 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
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 Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington echo "I: Checking order fixed (cache)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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 Wellingtonecho "I: Checking order cyclic (cache + additional)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# prime acache
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
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 Wellington $DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
13090db2b1c210b8386793ff0cbbb0b4348c1ecaBrian Wellington cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order cyclic (cache)"
8804fd9936acd703073c4a75072852c38738a990Brian Wellington# prime acache
8804fd9936acd703073c4a75072852c38738a990Brian Wellington$DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
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 Wellington $DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
8804fd9936acd703073c4a75072852c38738a990Brian Wellington cmp -s dig.out.cyclic2 dig.out.$j && matches=`expr $matches + 1`
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking order random (cache)"
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 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 Wellington $DIGCMD @10.53.0.3 random.example > dig.out.random || ret=1
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 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
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 Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Checking default order no match in rrset-order (random)"
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 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 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 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 eval "cmp -s dig.out.random dig.out.random.good$j && match$j=1 match=1"
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 Wellingtoneval "match=\`expr \$match + \$match$i\`"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I: Random selection return $match of 24 possible orders in 36 samples"
8804fd9936acd703073c4a75072852c38738a990Brian Wellingtonecho "I:exit status: $status"