From 41a632bae1f7f94374eea4861eeaba4afd69bd9e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 11 Jul 2018 13:49:26 +1000 Subject: [PATCH] add test for bad dig option '+ednsopt=:' being handled gracefully (cherry picked from commit ad86878d61c78aa7a90a420783227a90d6c4222f) (cherry picked from commit 9f126bac325196050371859e354849fc1e6b789f) --- bin/tests/system/digdelv/tests.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 775a6b8eb7..91fb5a32c5 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -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