[master] dig: retain domain when retrying with tcp

4712.	[bug]		"dig +domain" and "dig +search" didn't retain the
			search domain when retrying with TCP. [RT #45547]
This commit is contained in:
Evan Hunt
2017-09-11 10:10:16 -07:00
parent 3e66721b35
commit 8e014c45ae
5 changed files with 48 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ status=0
n=0
# using dig insecure mode as not testing dnssec here
DIGOPTS="-i -p 5300"
SENDCMD="$PERL $SYSTEMTESTTOP/send.pl 10.53.0.4 5301"
if [ -x ${DIG} ] ; then
n=`expr $n + 1`
@@ -198,6 +199,18 @@ if [ -x ${DIG} ] ; then
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I:checking dig preserves origin on TCP retries ($n)"
ret=0
# Ask ans4 to still accept TCP connections, but not respond to queries
echo "//" | $SENDCMD
$DIG $DIGOPTS -d +tcp @10.53.0.4 +retry=1 +time=1 +domain=bar foo > dig.out.test$n 2>&1 && ret=1
l=`grep "trying origin bar" dig.out.test$n | wc -l`
[ ${l:-0} -eq 2 ] || ret=1
grep "using root origin" < 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:checking dig -6 -4 ($n)"
ret=0