eliminate unnecessary waiting in allow-query test

- grep in the log to see if configuration is finished rather
  than sleeping for 5 seconds
This commit is contained in:
Evan Hunt
2018-02-26 16:48:42 -08:00
parent ffc3e73c36
commit a9b6bed6af
49 changed files with 60 additions and 370 deletions

View File

@@ -57,11 +57,17 @@ DIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnss
rndc_reload() {
echo_i "`$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p ${CONTROLPORT} reload 2>&1 | sed 's/^/ns2 /'`"
for try in 0 1 2 3 4 5 6 7 8 9; do
nextpart ns2/named.run | grep "reloading configuration succeeded" > /dev/null && break
sleep 1
done
}
status=0
n=0
nextpart ns2/named.run > /dev/null
# Test 1 - default, query allowed
n=`expr $n + 1`
echo_i "test $n: default - query allowed"
@@ -76,7 +82,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named02.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: explicit any - query allowed"
ret=0
@@ -90,7 +95,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named03.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: none - query refused"
ret=0
@@ -104,7 +108,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named04.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: address allowed - query allowed"
ret=0
@@ -118,7 +121,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named05.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: address not allowed - query refused"
ret=0
@@ -132,7 +134,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named06.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: address disallowed - query refused"
ret=0
@@ -146,7 +147,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named07.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: acl allowed - query allowed"
ret=0
@@ -160,7 +160,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named08.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: acl not allowed - query refused"
ret=0
@@ -175,7 +174,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named09.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: acl disallowed - query refused"
ret=0
@@ -189,7 +187,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named10.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: key allowed - query allowed"
ret=0
@@ -203,7 +200,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named11.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: key not allowed - query refused"
ret=0
@@ -217,7 +213,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named12.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: key disallowed - query refused"
ret=0
@@ -234,7 +229,6 @@ n=20
n=`expr $n + 1`
copy_setports ns2/named21.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views default - query allowed"
ret=0
@@ -248,7 +242,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named22.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views explicit any - query allowed"
ret=0
@@ -262,7 +255,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named23.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views none - query refused"
ret=0
@@ -276,7 +268,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named24.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views address allowed - query allowed"
ret=0
@@ -290,7 +281,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named25.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views address not allowed - query refused"
ret=0
@@ -304,7 +294,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named26.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views address disallowed - query refused"
ret=0
@@ -318,7 +307,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named27.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views acl allowed - query allowed"
ret=0
@@ -332,7 +320,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named28.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views acl not allowed - query refused"
ret=0
@@ -346,7 +333,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named29.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views acl disallowed - query refused"
ret=0
@@ -360,7 +346,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named30.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views key allowed - query allowed"
ret=0
@@ -374,7 +359,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named31.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views key not allowed - query refused"
ret=0
@@ -388,7 +372,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named32.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views key disallowed - query refused"
ret=0
@@ -402,7 +385,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named33.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views over options, views allow - query allowed"
ret=0
@@ -416,7 +398,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named34.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views over options, views disallow - query refused"
ret=0
@@ -434,7 +415,6 @@ n=40
n=`expr $n + 1`
copy_setports ns2/named40.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: zone default - query allowed"
ret=0
@@ -558,7 +538,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named53.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views over options, views allow - query allowed"
ret=0
@@ -572,7 +551,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named54.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: views over options, views disallow - query refused"
ret=0
@@ -586,7 +564,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named55.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: zones over views, views allow - query allowed"
ret=0
@@ -600,7 +577,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named56.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: zones over views, views disallow - query refused"
ret=0
@@ -614,7 +590,6 @@ status=`expr $status + $ret`
n=`expr $n + 1`
copy_setports ns2/named57.conf.in ns2/named.conf
rndc_reload
sleep 5
echo_i "test $n: zones over views, allow-query-on"
ret=0