Commit b3f06729 authored by Mark Andrews's avatar Mark Andrews

address timing issues in padding system test

'rndc stats' is not instantaneous. Wait for the dump to complete
before looking at the content.
parent a2254f01
Pipeline #31637 passed with stages
in 32 minutes and 36 seconds
......@@ -378,14 +378,14 @@ nextpartpeek() {
_search_log() (
msg="$1"
file="$2"
nextpart "$file" | grep -F "$msg" > /dev/null
nextpart "$file" | grep -F -e "$msg" > /dev/null
)
# _search_log_peek: look for message $1 in file $2 with nextpartpeek().
_search_log_peek() (
msg="$1"
file="$2"
nextpartpeek "$file" | grep -F "$msg" > /dev/null
nextpartpeek "$file" | grep -F -e "$msg" > /dev/null
)
# wait_for_log: wait until message $2 in file $3 appears. Bail out after
......
......@@ -11,6 +11,7 @@ rm -f dig.out.*
rm -f ns*/named.memstats
rm -f ns*/named.run
rm -f ns*/named.stats
rm -f ns*/named.stats.prev
rm -f ns*/named.lock
rm -f ns*/named.conf
rm -f ns*/managed-keys.bind*
......@@ -12,7 +12,11 @@
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
$SHELL ./clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
touch ns2/named.stats
......@@ -36,8 +36,11 @@ status=`expr $status + $ret`
echo_i "checking that dig added padding ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
grep "EDNS padding option received" ns2/named.stats > /dev/null || ret=1
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
nextpart ns2/named.stats | grep "EDNS padding option received" > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
......@@ -88,28 +91,30 @@ status=`expr $status + $ret`
echo_i "checking that a TCP and padding server config enables padding ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
opad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
opad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
$DIG $DIGOPTS foo.example @10.53.0.3 > dig.out.test$n
$RNDCCMD 10.53.0.2 stats
npad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
if [ "$opad" -eq "$npad" ]; then ret=1; fi
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
npad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
if [ "$opad" -eq "$npad" ]; then echo_i "error: opad ($opad) == npad ($npad)"; ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
echo_i "checking that a padding server config should enforce TCP ($n)"
ret=0
n=`expr $n + 1`
nextpart ns2/named.stats > /dev/null
$RNDCCMD 10.53.0.2 stats
opad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
opad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
$DIG $DIGOPTS foo.example @10.53.0.4 > dig.out.test$n
$RNDCCMD 10.53.0.2 stats
npad=`grep "EDNS padding option received" ns2/named.stats | \
tail -1 | awk '{ print $1}'`
if [ "$opad" -ne "$npad" ]; then ret=1; fi
wait_for_log_peek 5 "--- Statistics Dump ---" ns2/named.stats || ret=1
npad=`nextpart ns2/named.stats | awk '/EDNS padding option received/ { print $1}'`
if [ "$opad" -ne "$npad" ]; then echo_i "error: opad ($opad) != npad ($npad)"; ret=1; fi
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment