diff --git a/bin/tests/system/rrsetorder/tests.sh b/bin/tests/system/rrsetorder/tests.sh index b2159c6cca..278fe4a5c6 100644 --- a/bin/tests/system/rrsetorder/tests.sh +++ b/bin/tests/system/rrsetorder/tests.sh @@ -14,7 +14,11 @@ . ../conf.sh DIGOPTS="+nosea +nocomm +nocmd +noquest +noadd +noauth +nocomm +nostat +short +nocookie" -DIGCMD="$DIG $DIGOPTS -p ${PORT}" + +dig_cmd() { + # shellcheck disable=SC2086 + "$DIG" $DIGOPTS -p "${PORT}" "$@" | grep -v '^;' +} status=0 @@ -36,7 +40,7 @@ if $test_fixed; then 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 + dig_cmd @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 @@ -48,7 +52,7 @@ else for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do j=$((i % 4)) - $DIGCMD @10.53.0.1 fixed.example > dig.out.fixed || ret=1 + dig_cmd @10.53.0.1 fixed.example > dig.out.fixed || ret=1 if [ $i -le 4 ]; then cp dig.out.fixed dig.out.$j else @@ -75,7 +79,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1 + dig_cmd @10.53.0.1 cyclic.example > dig.out.cyclic || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else @@ -101,7 +105,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.1 cyclic2.example > dig.out.cyclic2 || ret=1 + dig_cmd @10.53.0.1 cyclic2.example > dig.out.cyclic2 || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else @@ -125,7 +129,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 - $DIGCMD @10.53.0.1 random.example > dig.out.random || ret=1 + dig_cmd @10.53.0.1 random.example > dig.out.random || ret=1 match=0 for j in $GOOD_RANDOM do @@ -147,13 +151,13 @@ status=$((status + ret)) echo_i "Checking order none (primary)" ret=0 # Fetch the "reference" response and ensure it contains the expected records. -$DIGCMD @10.53.0.1 none.example > dig.out.none || ret=1 +dig_cmd @10.53.0.1 none.example > dig.out.none || ret=1 for i in 1 2 3 4; do grep -F -q 1.2.3.$i dig.out.none || ret=1 done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do - $DIGCMD @10.53.0.1 none.example > dig.out.test$i || ret=1 + dig_cmd @10.53.0.1 none.example > dig.out.test$i || ret=1 diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -167,7 +171,7 @@ if $test_fixed; then 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 + dig_cmd @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 @@ -183,7 +187,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 + dig_cmd @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else @@ -209,7 +213,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1 + dig_cmd @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else @@ -234,7 +238,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 - $DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1 + dig_cmd @10.53.0.2 random.example > dig.out.random || ret=1 match=0 for j in $GOOD_RANDOM do @@ -256,13 +260,13 @@ status=$((status + ret)) echo_i "Checking order none (secondary)" ret=0 # Fetch the "reference" response and ensure it contains the expected records. -$DIGCMD @10.53.0.2 none.example > dig.out.none || ret=1 +dig_cmd @10.53.0.2 none.example > dig.out.none || ret=1 for i in 1 2 3 4; do grep -F -q 1.2.3.$i dig.out.none || ret=1 done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do - $DIGCMD @10.53.0.2 none.example > dig.out.test$i || ret=1 + dig_cmd @10.53.0.2 none.example > dig.out.test$i || ret=1 diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -292,7 +296,7 @@ if $test_fixed; then 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 + dig_cmd @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 @@ -308,7 +312,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 + dig_cmd @10.53.0.2 cyclic.example > dig.out.cyclic || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else @@ -334,7 +338,7 @@ 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 j=$((i % 4)) - $DIGCMD @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1 + dig_cmd @10.53.0.2 cyclic2.example > dig.out.cyclic2 || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else @@ -359,7 +363,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 - $DIGCMD @10.53.0.2 random.example > dig.out.random || ret=1 + dig_cmd @10.53.0.2 random.example > dig.out.random || ret=1 match=0 for j in $GOOD_RANDOM do @@ -381,13 +385,13 @@ status=$((status + ret)) echo_i "Checking order none (secondary loaded from disk)" ret=0 # Fetch the "reference" response and ensure it contains the expected records. -$DIGCMD @10.53.0.2 none.example > dig.out.none || ret=1 +dig_cmd @10.53.0.2 none.example > dig.out.none || ret=1 for i in 1 2 3 4; do grep -F -q 1.2.3.$i dig.out.none || ret=1 done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do - $DIGCMD @10.53.0.2 none.example > dig.out.test$i || ret=1 + dig_cmd @10.53.0.2 none.example > dig.out.test$i || ret=1 diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -401,7 +405,7 @@ if $test_fixed; then 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 + dig_cmd @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 @@ -414,12 +418,12 @@ fi echo_i "Checking order cyclic (cache + additional)" ret=0 # prime acache -$DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 +dig_cmd @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 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 j=$((i % 4)) - $DIGCMD @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 + dig_cmd @10.53.0.3 cyclic.example > dig.out.cyclic || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic dig.out.$j else @@ -442,12 +446,12 @@ status=$((status + ret)) echo_i "Checking order cyclic (cache)" ret=0 # prime acache -$DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1 +dig_cmd @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1 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 j=$((i % 4)) - $DIGCMD @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1 + dig_cmd @10.53.0.3 cyclic2.example > dig.out.cyclic2 || ret=1 if [ $i -le 4 ]; then cp dig.out.cyclic2 dig.out.$j else @@ -472,7 +476,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 - $DIGCMD @10.53.0.3 random.example > dig.out.random || ret=1 + dig_cmd @10.53.0.3 random.example > dig.out.random || ret=1 match=0 for j in $GOOD_RANDOM do @@ -494,13 +498,13 @@ status=$((status + ret)) echo_i "Checking order none (cache)" ret=0 # Fetch the "reference" response and ensure it contains the expected records. -$DIGCMD @10.53.0.3 none.example > dig.out.none || ret=1 +dig_cmd @10.53.0.3 none.example > dig.out.none || ret=1 for i in 1 2 3 4; do grep -F -q 1.2.3.$i dig.out.none || ret=1 done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do - $DIGCMD @10.53.0.3 none.example > dig.out.test$i || ret=1 + dig_cmd @10.53.0.3 none.example > dig.out.test$i || ret=1 diff dig.out.none dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi @@ -514,7 +518,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 - $DIGCMD @10.53.0.5 random.example > dig.out.random || ret=1 + dig_cmd @10.53.0.5 random.example > dig.out.random || ret=1 match=0 for j in $GOOD_RANDOM do @@ -536,13 +540,13 @@ status=$((status + ret)) echo_i "Checking default order no match in rrset-order (cache)" ret=0 # Fetch the "reference" response and ensure it contains the expected records. -$DIGCMD @10.53.0.4 nomatch.example > dig.out.nomatch || ret=1 +dig_cmd @10.53.0.4 nomatch.example > dig.out.nomatch || ret=1 for i in 1 2 3 4; do grep -F -q 1.2.3.$i dig.out.nomatch || ret=1 done # Ensure 20 further queries result in the same response as the "reference" one. for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do - $DIGCMD @10.53.0.4 nomatch.example > dig.out.test$i || ret=1 + dig_cmd @10.53.0.4 nomatch.example > dig.out.test$i || ret=1 diff dig.out.nomatch dig.out.test$i >/dev/null || ret=1 done if [ $ret != 0 ]; then echo_i "failed"; fi