From: Evan Hunt Date: Thu, 24 Apr 2008 21:52:18 +0000 (+0000) Subject: Change rrsetorder test two ways: X-Git-Tag: v9.5.0rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982f479ef8a7f1259d466475c83f8125fdd19302;p=thirdparty%2Fbind9.git Change rrsetorder test two ways: 1) only test "fixed" ordering if it was compiled in 2) test whether "cyclic" ordering is cyclic, but don't rely on the initial state being predictable [rt17977] --- diff --git a/bin/tests/system/rrsetorder/clean.sh b/bin/tests/system/rrsetorder/clean.sh index 0cb15620c2c..00ebff04fd6 100644 --- a/bin/tests/system/rrsetorder/clean.sh +++ b/bin/tests/system/rrsetorder/clean.sh @@ -14,9 +14,10 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: clean.sh,v 1.6 2007/09/26 03:22:44 marka Exp $ +# $Id: clean.sh,v 1.6.46.1 2008/04/24 21:52:18 each Exp $ rm -f dig.out.cyclic dig.out.fixed dig.out.random +rm -f dig.out.0 dig.out.1 dig.out.2 dig.out.3 rm -f ns2/root.bk rm -f ns?/named.run ns?/named.core rm -f */named.memstats diff --git a/bin/tests/system/rrsetorder/dig.out.cyclic.good1 b/bin/tests/system/rrsetorder/dig.out.cyclic.good1 deleted file mode 100644 index d2ca6fc3661..00000000000 --- a/bin/tests/system/rrsetorder/dig.out.cyclic.good1 +++ /dev/null @@ -1,4 +0,0 @@ -1.2.3.1 -1.2.3.4 -1.2.3.3 -1.2.3.2 diff --git a/bin/tests/system/rrsetorder/dig.out.cyclic.good2 b/bin/tests/system/rrsetorder/dig.out.cyclic.good2 deleted file mode 100644 index c25c75601e9..00000000000 --- a/bin/tests/system/rrsetorder/dig.out.cyclic.good2 +++ /dev/null @@ -1,4 +0,0 @@ -1.2.3.4 -1.2.3.3 -1.2.3.2 -1.2.3.1 diff --git a/bin/tests/system/rrsetorder/dig.out.cyclic.good3 b/bin/tests/system/rrsetorder/dig.out.cyclic.good3 deleted file mode 100644 index e8deb6717db..00000000000 --- a/bin/tests/system/rrsetorder/dig.out.cyclic.good3 +++ /dev/null @@ -1,4 +0,0 @@ -1.2.3.3 -1.2.3.2 -1.2.3.1 -1.2.3.4 diff --git a/bin/tests/system/rrsetorder/dig.out.cyclic.good4 b/bin/tests/system/rrsetorder/dig.out.cyclic.good4 deleted file mode 100644 index 3b276939588..00000000000 --- a/bin/tests/system/rrsetorder/dig.out.cyclic.good4 +++ /dev/null @@ -1,4 +0,0 @@ -1.2.3.2 -1.2.3.1 -1.2.3.4 -1.2.3.3 diff --git a/bin/tests/system/rrsetorder/tests.sh b/bin/tests/system/rrsetorder/tests.sh index de9136e99af..5a63def6a05 100644 --- a/bin/tests/system/rrsetorder/tests.sh +++ b/bin/tests/system/rrsetorder/tests.sh @@ -14,54 +14,60 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: tests.sh,v 1.5 2007/06/19 23:47:05 tbox Exp $ +# $Id: tests.sh,v 1.5.128.1 2008/04/24 21:52:18 each Exp $ SYSTEMTESTTOP=.. . $SYSTEMTESTTOP/conf.sh status=0 +if grep -q "^#define DNS_RDATASET_FIXED" $TOP/config.h; then + test_fixed=true +else + echo "I: Order 'fixed' disabled at compile time" + test_fixed=false +fi + # # # -echo "I: Checking order fixed (master)" -ret=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.1 fixed.example > dig.out.fixed || ret=1 -cmp -s dig.out.fixed dig.out.fixed.good || ret=1 -done -if [ $ret != 0 ]; then echo "I:failed"; fi -status=`expr $status + $ret` +if $test_fixed; then + echo "I: Checking order fixed (master)" + ret=0 + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + do + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.1 fixed.example > dig.out.fixed || ret=1 + cmp -s dig.out.fixed dig.out.fixed.good || ret=1 + done + if [ $ret != 0 ]; then echo "I:failed"; fi + status=`expr $status + $ret` +fi # # # echo "I: Checking order cyclic (master)" ret=0 -match1=0 -match2=0 -match3=0 -match4=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +matches=0 +for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1 -cmp -s dig.out.cyclic dig.out.cyclic.good1 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good2 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good3 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good4 || \ -ret=1 - -cmp -s dig.out.cyclic dig.out.cyclic.good1 && match1=1 -cmp -s dig.out.cyclic dig.out.cyclic.good2 && match2=1 -cmp -s dig.out.cyclic dig.out.cyclic.good3 && match3=1 -cmp -s dig.out.cyclic dig.out.cyclic.good4 && match4=1 - + j=`expr $i % 4` + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1 + if [ $i -le 4 ]; then + cp dig.out.cyclic dig.out.$j + else + cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1` + fi done -match=`expr $match1 + $match2 + $match3 + $match4` -if [ $match != 4 ]; then ret=1; fi +cmp -s dig.out.0 dig.out.1 && ret=1 +cmp -s dig.out.0 dig.out.2 && ret=1 +cmp -s dig.out.0 dig.out.3 && ret=1 +cmp -s dig.out.1 dig.out.2 && ret=1 +cmp -s dig.out.1 dig.out.3 && ret=1 +cmp -s dig.out.2 dig.out.3 && ret=1 +if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -96,44 +102,43 @@ status=`expr $status + $ret` # # # -echo "I: Checking order fixed (slave)" -ret=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.2 fixed.example > dig.out.fixed || ret=1 -cmp -s dig.out.fixed dig.out.fixed.good || ret=1 -done -if [ $ret != 0 ]; then echo "I:failed"; fi -status=`expr $status + $ret` +if $test_fixed; then + echo "I: Checking order fixed (slave)" + ret=0 + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + do + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.2 fixed.example > dig.out.fixed || ret=1 + cmp -s dig.out.fixed dig.out.fixed.good || ret=1 + done + if [ $ret != 0 ]; then echo "I:failed"; fi + status=`expr $status + $ret` +fi # # # echo "I: Checking order cyclic (slave)" ret=0 -match1=0 -match2=0 -match3=0 -match4=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +matches=0 +for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 -cmp -s dig.out.cyclic dig.out.cyclic.good1 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good2 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good3 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good4 || \ -ret=1 - -cmp -s dig.out.cyclic dig.out.cyclic.good1 && match1=1 -cmp -s dig.out.cyclic dig.out.cyclic.good2 && match2=1 -cmp -s dig.out.cyclic dig.out.cyclic.good3 && match3=1 -cmp -s dig.out.cyclic dig.out.cyclic.good4 && match4=1 - + j=`expr $i % 4` + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 + if [ $i -le 4 ]; then + cp dig.out.cyclic dig.out.$j + else + cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1` + fi done -match=`expr $match1 + $match2 + $match3 + $match4` -if [ $match != 4 ]; then ret=1; fi +cmp -s dig.out.0 dig.out.1 && ret=1 +cmp -s dig.out.0 dig.out.2 && ret=1 +cmp -s dig.out.0 dig.out.3 && ret=1 +cmp -s dig.out.1 dig.out.2 && ret=1 +cmp -s dig.out.1 dig.out.3 && ret=1 +cmp -s dig.out.2 dig.out.3 && ret=1 +if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -184,44 +189,43 @@ echo "I: Re-starting slave" # # # -echo "I: Checking order fixed (slave loaded from disk)" -ret=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.2 fixed.example > dig.out.fixed || ret=1 -cmp -s dig.out.fixed dig.out.fixed.good || ret=1 -done -if [ $ret != 0 ]; then echo "I:failed"; fi -status=`expr $status + $ret` +if $test_fixed; then + echo "I: Checking order fixed (slave loaded from disk)" + ret=0 + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + do + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.2 fixed.example > dig.out.fixed || ret=1 + cmp -s dig.out.fixed dig.out.fixed.good || ret=1 + done + if [ $ret != 0 ]; then echo "I:failed"; fi + status=`expr $status + $ret` +fi # # # echo "I: Checking order cyclic (slave loaded from disk)" ret=0 -match1=0 -match2=0 -match3=0 -match4=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +matches=0 +for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 -cmp -s dig.out.cyclic dig.out.cyclic.good1 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good2 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good3 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good4 || \ -ret=1 - -cmp -s dig.out.cyclic dig.out.cyclic.good1 && match1=1 -cmp -s dig.out.cyclic dig.out.cyclic.good2 && match2=1 -cmp -s dig.out.cyclic dig.out.cyclic.good3 && match3=1 -cmp -s dig.out.cyclic dig.out.cyclic.good4 && match4=1 - + j=`expr $i % 4` + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 + if [ $i -le 4 ]; then + cp dig.out.cyclic dig.out.$j + else + cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1` + fi done -match=`expr $match1 + $match2 + $match3 + $match4` -if [ $match != 4 ]; then ret=1; fi +cmp -s dig.out.0 dig.out.1 && ret=1 +cmp -s dig.out.0 dig.out.2 && ret=1 +cmp -s dig.out.0 dig.out.3 && ret=1 +cmp -s dig.out.1 dig.out.2 && ret=1 +cmp -s dig.out.1 dig.out.3 && ret=1 +cmp -s dig.out.2 dig.out.3 && ret=1 +if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` @@ -256,44 +260,43 @@ status=`expr $status + $ret` # # # -echo "I: Checking order fixed (cache)" -ret=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.3 fixed.example > dig.out.fixed || ret=1 -cmp -s dig.out.fixed dig.out.fixed.good || ret=1 -done -if [ $ret != 0 ]; then echo "I:failed"; fi -status=`expr $status + $ret` +if $test_fixed; then + echo "I: Checking order fixed (cache)" + ret=0 + for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + do + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.3 fixed.example > dig.out.fixed || ret=1 + cmp -s dig.out.fixed dig.out.fixed.good || ret=1 + done + if [ $ret != 0 ]; then echo "I:failed"; fi + status=`expr $status + $ret` +fi # # # echo "I: Checking order cyclic (cache)" ret=0 -match1=0 -match2=0 -match3=0 -match4=0 -for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +matches=0 +for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do -$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ - -p 5300 @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 -cmp -s dig.out.cyclic dig.out.cyclic.good1 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good2 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good3 || \ -cmp -s dig.out.cyclic dig.out.cyclic.good4 || \ -ret=1 - -cmp -s dig.out.cyclic dig.out.cyclic.good1 && match1=1 -cmp -s dig.out.cyclic dig.out.cyclic.good2 && match2=1 -cmp -s dig.out.cyclic dig.out.cyclic.good3 && match3=1 -cmp -s dig.out.cyclic dig.out.cyclic.good4 && match4=1 - + j=`expr $i % 4` + $DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \ + -p 5300 @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 + if [ $i -le 4 ]; then + cp dig.out.cyclic dig.out.$j + else + cmp -s dig.out.cyclic dig.out.$j && matches=`expr $matches + 1` + fi done -match=`expr $match1 + $match2 + $match3 + $match4` -if [ $match != 4 ]; then ret=1; fi +cmp -s dig.out.0 dig.out.1 && ret=1 +cmp -s dig.out.0 dig.out.2 && ret=1 +cmp -s dig.out.0 dig.out.3 && ret=1 +cmp -s dig.out.1 dig.out.2 && ret=1 +cmp -s dig.out.1 dig.out.3 && ret=1 +cmp -s dig.out.2 dig.out.3 && ret=1 +if [ $matches -ne 16 ]; then ret=1; fi if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret`