add test for bad dig option '+ednsopt=:' being handled gracefully

(cherry picked from commit ad86878d61)
(cherry picked from commit 9f126bac32)
This commit is contained in:
Mark Andrews 2018-07-11 13:49:26 +10:00 committed by Evan Hunt
parent d7d3383573
commit 41a632bae1

View file

@ -354,7 +354,7 @@ if [ -x ${DIG} ] ; then
n=`expr $n + 1`
echo_i "checking dig +subnet with prefix lengths between byte boundaries ($n)"
ret=0
ret=0
for p in 9 10 11 12 13 14 15; do
$DIG $DIGOPTS +tcp @10.53.0.2 +subnet=10.53/$p A a.example > dig.out.test.$p.$n 2>&1 || ret=1
grep "FORMERR" < dig.out.test.$p.$n > /dev/null && ret=1
@ -455,6 +455,14 @@ if [ -x ${DIG} ] ; then
grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo_i "check that dig handles malformed option '+ednsopt=:' gracefully ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.3 +ednsopt=: a.example > dig.out.test$n 2>&1 && ret=1
grep "ednsopt no code point specified" dig.out.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
else
echo_i "$DIG is needed, so skipping these dig tests"
fi