Modify the rrsetorder test to cope with the rrset order randomization (only four orders are now possible)
This commit is contained in:
@@ -17,6 +17,9 @@ DIGCMD="$DIG $DIGOPTS -p ${PORT}"
|
||||
|
||||
status=0
|
||||
|
||||
GOOD_RANDOM="$(seq 1 24)"
|
||||
GOOD_RANDOM_NO=24
|
||||
|
||||
if grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
|
||||
test_fixed=true
|
||||
else
|
||||
@@ -115,7 +118,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
echo_i "Checking order random (master)"
|
||||
ret=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -123,7 +126,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.1 random.example > dig.out.random || ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -131,12 +134,12 @@ do
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Random selection return $match of 24 possible orders in 36 samples"
|
||||
if [ $match -lt 8 ]; then ret=1; fi
|
||||
echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
@@ -209,7 +212,7 @@ status=`expr $status + $ret`
|
||||
|
||||
echo_i "Checking order random (slave)"
|
||||
ret=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -217,7 +220,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -225,12 +228,12 @@ do
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Random selection return $match of 24 possible orders in 36 samples"
|
||||
if [ $match -lt 8 ]; then ret=1; fi
|
||||
echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
@@ -319,7 +322,7 @@ status=`expr $status + $ret`
|
||||
|
||||
echo_i "Checking order random (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 17 18 19 20 21 22 23 24
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -327,7 +330,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -335,12 +338,12 @@ do
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Random selection return $match of 24 possible orders in 36 samples"
|
||||
if [ $match -lt 8 ]; then ret=1; fi
|
||||
echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
@@ -417,7 +420,7 @@ status=`expr $status + $ret`
|
||||
|
||||
echo_i "Checking order random (cache)"
|
||||
ret=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -425,7 +428,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.3 random.example > dig.out.random || ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -433,17 +436,17 @@ do
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Random selection return $match of 24 possible orders in 36 samples"
|
||||
if [ $match -lt 8 ]; then ret=1; fi
|
||||
echo_i "Random selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
|
||||
echo_i "Checking default order (cache)"
|
||||
ret=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -451,7 +454,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.5 random.example > dig.out.random || ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.random dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -459,17 +462,17 @@ do
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Default selection return $match of 24 possible orders in 36 samples"
|
||||
if [ $match -lt 8 ]; then ret=1; fi
|
||||
echo_i "Default selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -lt $(((${GOOD_RANDOM_NO}/3))) ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
|
||||
echo_i "Checking default order no match in rrset-order (no shuffling)"
|
||||
ret=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval match$i=0
|
||||
done
|
||||
@@ -477,7 +480,7 @@ for 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
|
||||
do
|
||||
$DIGCMD @10.53.0.4 nomatch.example > dig.out.nomatch|| ret=1
|
||||
match=0
|
||||
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
|
||||
for j in $GOOD_RANDOM
|
||||
do
|
||||
eval "$DIFF dig.out.nomatch dig.out.random.good$j >/dev/null && match$j=1 match=1"
|
||||
if [ $match -eq 1 ]; then break; fi
|
||||
@@ -485,11 +488,11 @@ $DIGCMD @10.53.0.4 nomatch.example > dig.out.nomatch|| ret=1
|
||||
if [ $match -eq 0 ]; then ret=1; fi
|
||||
done
|
||||
match=0
|
||||
for 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
|
||||
for i in $GOOD_RANDOM
|
||||
do
|
||||
eval "match=\`expr \$match + \$match$i\`"
|
||||
done
|
||||
echo_i "Consistent selection return $match of 24 possible orders in 36 samples"
|
||||
echo_i "Consistent selection return $match of ${GOOD_RANDOM_NO} possible orders in 36 samples"
|
||||
if [ $match -ne 1 ]; then ret=1; fi
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user