parallelize most system tests

This commit is contained in:
Evan Hunt
2018-02-20 15:43:27 -08:00
parent 0217cc8bb2
commit c032c54dda
621 changed files with 7697 additions and 7749 deletions

View File

@@ -10,32 +10,32 @@ SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
DIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short +nocookie"
DIGCMD="$DIG $DIGOPTS -p 5300"
DIGCMD="$DIG $DIGOPTS -p ${PORT}"
status=0
if grep "^#define DNS_RDATASET_FIXED" $TOP/config.h > /dev/null 2>&1 ; then
test_fixed=true
test_fixed=true
else
echo "I: Order 'fixed' disabled at compile time"
test_fixed=false
echo_i "Order 'fixed' disabled at compile time"
test_fixed=false
fi
#
#
#
if $test_fixed; then
echo "I: Checking order fixed (master)"
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
$DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1
$DIFF dig.out.fixed dig.out.fixed.good >/dev/null || ret=1
done
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
else
echo "I: Checking order fixed behaves as cyclic when disabled (master)"
echo_i "Checking order fixed behaves as cyclic when disabled (master)"
ret=0
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
@@ -55,14 +55,14 @@ else
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
fi
#
#
#
echo "I: Checking order cyclic (master + additional)"
echo_i "Checking order cyclic (master + additional)"
ret=0
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
@@ -82,13 +82,13 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
echo "I: Checking order cyclic (master)"
echo_i "Checking order cyclic (master)"
ret=0
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
@@ -108,9 +108,9 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I: Checking order random (master)"
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
do
@@ -118,44 +118,44 @@ do
done
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
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
done
if [ $match -eq 0 ]; then ret=1; fi
$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
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
done
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
do
eval "match=\`expr \$match + \$match$i\`"
done
echo "I: Random selection return $match of 24 possible orders in 36 samples"
echo_i "Random selection return $match of 24 possible orders in 36 samples"
if [ $match -lt 8 ]; then echo ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
if $test_fixed; then
echo "I: Checking order fixed (slave)"
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
$DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
$DIFF dig.out.fixed dig.out.fixed.good || ret=1
done
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
fi
#
#
#
echo "I: Checking order cyclic (slave + additional)"
echo_i "Checking order cyclic (slave + additional)"
ret=0
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
@@ -175,13 +175,13 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
echo "I: Checking order cyclic (slave)"
echo_i "Checking order cyclic (slave)"
ret=0
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
@@ -201,10 +201,10 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I: Checking order random (slave)"
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
do
@@ -212,60 +212,60 @@ do
done
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
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
done
if [ $match -eq 0 ]; then ret=1; fi
$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
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
done
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
do
eval "match=\`expr \$match + \$match$i\`"
done
echo "I: Random selection return $match of 24 possible orders in 36 samples"
echo_i "Random selection return $match of 24 possible orders in 36 samples"
if [ $match -lt 8 ]; then echo ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I: Shutting down slave"
echo_i "Shutting down slave"
(cd ..; $SHELL stop.sh rrsetorder ns2 )
echo "I: Checking for slave's on disk copy of zone"
echo_i "Checking for slave's on disk copy of zone"
if [ ! -f ns2/root.bk ]
then
echo "I:failed";
echo_i "failed";
status=`expr $status + 1`
fi
echo "I: Re-starting slave"
echo_i "Re-starting slave"
(cd ..; $SHELL start.sh --noclean rrsetorder ns2 )
(cd ..; $PERL start.pl --noclean --port ${PORT} rrsetorder ns2 )
#
#
#
if $test_fixed; then
echo "I: Checking order fixed (slave loaded from disk)"
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
$DIGCMD @10.53.0.2 fixed.example > dig.out.fixed || ret=1
$DIFF dig.out.fixed dig.out.fixed.good || ret=1
done
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
fi
#
#
#
echo "I: Checking order cyclic (slave + additional, loaded from disk)"
echo_i "Checking order cyclic (slave + additional, loaded from disk)"
ret=0
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
@@ -285,13 +285,13 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
echo "I: Checking order cyclic (slave loaded from disk)"
echo_i "Checking order cyclic (slave loaded from disk)"
ret=0
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
@@ -311,10 +311,10 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I: Checking order random (slave loaded from disk)"
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
do
@@ -336,30 +336,30 @@ 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
do
eval "match=\`expr \$match + \$match$i\`"
done
echo "I: Random selection return $match of 24 possible orders in 36 samples"
echo_i "Random selection return $match of 24 possible orders in 36 samples"
if [ $match -lt 8 ]; then echo ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
if $test_fixed; then
echo "I: Checking order fixed (cache)"
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
$DIGCMD @10.53.0.3 fixed.example > dig.out.fixed || ret=1
$DIFF dig.out.fixed dig.out.fixed.good || ret=1
done
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
fi
#
#
#
echo "I: Checking order cyclic (cache + additional)"
echo_i "Checking order cyclic (cache + additional)"
ret=0
# prime acache
$DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1
@@ -381,13 +381,13 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
#
#
#
echo "I: Checking order cyclic (cache)"
echo_i "Checking order cyclic (cache)"
ret=0
# prime acache
$DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1
@@ -409,10 +409,10 @@ $DIFF dig.out.1 dig.out.2 >/dev/null && ret=1
$DIFF dig.out.1 dig.out.3 >/dev/null && ret=1
$DIFF dig.out.2 dig.out.3 >/dev/null && ret=1
if [ $matches -ne 16 ]; then ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I: Checking order random (cache)"
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
do
@@ -434,11 +434,11 @@ 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
do
eval "match=\`expr \$match + \$match$i\`"
done
echo "I: Random selection return $match of 24 possible orders in 36 samples"
echo_i "Random selection return $match of 24 possible orders in 36 samples"
if [ $match -lt 8 ]; then echo ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
echo "I: Checking default order no match in rrset-order (no shuffling)"
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
do
@@ -446,8 +446,7 @@ do
done
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
$DIG +nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short \
-p 5300 @10.53.0.4 nomatch.example > dig.out.nomatch|| ret=1
$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
do
@@ -461,10 +460,10 @@ 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
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 24 possible orders in 36 samples"
if [ $match -ne 1 ]; then echo ret=1; fi
if [ $ret != 0 ]; then echo "I:failed"; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1