mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '1522-pad-system-test-is-timing-sensitive' into 'master'
Resolve "padding system test is timing sensitive" Closes #907 and #1522 See merge request isc-projects/bind9!2782
This commit is contained in:
commit
82c418abfa
4 changed files with 23 additions and 13 deletions
|
|
@ -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`
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue