]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Change rrsetorder test two ways:
authorEvan Hunt <each@isc.org>
Thu, 24 Apr 2008 21:52:18 +0000 (21:52 +0000)
committerEvan Hunt <each@isc.org>
Thu, 24 Apr 2008 21:52:18 +0000 (21:52 +0000)
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]

bin/tests/system/rrsetorder/clean.sh
bin/tests/system/rrsetorder/dig.out.cyclic.good1 [deleted file]
bin/tests/system/rrsetorder/dig.out.cyclic.good2 [deleted file]
bin/tests/system/rrsetorder/dig.out.cyclic.good3 [deleted file]
bin/tests/system/rrsetorder/dig.out.cyclic.good4 [deleted file]
bin/tests/system/rrsetorder/tests.sh

index 0cb15620c2c10794fdf16ea3b9e72794eaf368eb..00ebff04fd64a574c3da7f0ff480110944bbddb0 100644 (file)
 # 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 (file)
index d2ca6fc..0000000
+++ /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 (file)
index c25c756..0000000
+++ /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 (file)
index e8deb67..0000000
+++ /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 (file)
index 3b27693..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-1.2.3.2
-1.2.3.1
-1.2.3.4
-1.2.3.3
index de9136e99af891e24283c36ed643a44fcccde6b8..5a63def6a05ce8ab3125d24fb9f323c991674e00 100644 (file)
 # 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`