[v9_11] 4496. [func] dig: add +idnout to control whether labels are

display in punycode or not.  Requires idn support
                        to be enabled at compile time. [RT #43398]

(cherry picked from commit 42470b0b87)
This commit is contained in:
Evan Hunt
2016-10-31 20:17:28 -07:00
parent fd44151797
commit 6552f33198
9 changed files with 87 additions and 6 deletions

View File

@@ -366,6 +366,23 @@ if [ -x ${DIG} ] ; then
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
if $FEATURETEST --with-idn
then
echo "I:checking dig +idnout ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.3 +noidnout xn--caf-dma.example. > dig.out.1.test$n 2>&1 || ret=1
$DIG $DIGOPTS @10.53.0.3 +idnout xn--caf-dma.example. > dig.out.2.test$n 2>&1 || ret=1
grep "^xn--caf-dma.example" dig.out.1.test$n > /dev/null || ret=1
grep "^xn--caf-dma.example" dig.out.2.test$n > /dev/null && ret=1
grep 10.1.2.3 dig.out.1.test$n > /dev/null || ret=1
grep 10.1.2.3 dig.out.2.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
else
echo "I:skipping 'dig +idnout' as IDN support is not enabled ($n)"
fi
else
echo "$DIG is needed, so skipping these dig tests"
fi