]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
digdelv: Extra quotes prevent IPv6 runs
authorMichal Nowak <mnowak@isc.org>
Fri, 1 Nov 2019 10:05:27 +0000 (10:05 +0000)
committerMichal Nowak <mnowak@isc.org>
Fri, 1 Nov 2019 10:05:27 +0000 (10:05 +0000)
Portion of the digdelv test are skipped on IPv6 due to extra quotes
around $TESTSOCK6: "I:digdelv:IPv6 unavailable; skipping".

Researched by @michal.

Regressed with 351efd8812560c97e1bc7f6142b80ac5798d6ded.

(cherry picked from commit 1b6419f8a7ed988fb17abb3dcc1e628c9e71339d)

bin/tests/system/conf.sh.in
bin/tests/system/conf.sh.win32
bin/tests/system/digdelv/tests.sh
bin/tests/system/filter-aaaa/tests.sh
bin/tests/system/geoip/tests.sh
bin/tests/system/geoip2/tests.sh
bin/tests/system/staticstub/tests.sh

index fb87c8e6bb3f49fd4e412a1e8af86c3920bbcc58..3ff4e617297eed560bf86cd0f82b25d33482572a 100644 (file)
@@ -152,23 +152,16 @@ XSLTPROC=@XSLTPROC@
 # PERL will be an empty string if no perl interpreter was found.
 PERL=@PERL@
 
-if test -n "$PERL"
-then
-       if $PERL -e "use IO::Socket::INET6;" 2> /dev/null
+testsock6() {
+       if test -n "$PERL" \
+               && $PERL -e "use IO::Socket::INET6;" 2> /dev/null \
+               && grep "^#define WANT_IPV6 1" "$TOP/config.h" > /dev/null 2>&1
        then
-               TESTSOCK6="$PERL $TOP/bin/tests/system/testsock6.pl"
+               $PERL "$TOP/bin/tests/system/testsock6.pl" "$@"
        else
-               TESTSOCK6=false
+               false
        fi
-else
-       TESTSOCK6=false
-fi
-
-if grep "^#define WANT_IPV6 1" $TOP/config.h > /dev/null 2>&1 ; then
-       TESTSOCK6="$TESTSOCK6"
-else
-       TESTSOCK6=false
-fi
+}
 
 # Windows process management leave empty
 PSSUSPEND=
@@ -463,4 +456,3 @@ export RRCHECKER
 export SAMPLEUPDATE
 export SIGNER
 export SUBDIRS
-export TESTSOCK6
index 97628663e13dd7a077dea20d90c35725f2191134..527a5c8768c71752fa641db8d55b58bdf9fb389d 100644 (file)
@@ -157,23 +157,16 @@ CURL=/usr/bin/curl
 XMLLINT=/usr/bin/xmllint
 PERL=/usr/bin/perl
 
-if test -n "$PERL"
-then
-       if $PERL -e "use IO::Socket::INET6;" 2> /dev/null
+testsock6() {
+       if test -n "$PERL" \
+               && $PERL -e "use IO::Socket::INET6;" 2> /dev/null \
+               && grep "^#define WANT_IPV6 1" "$TOP/config.h" > /dev/null 2>&1
        then
-               TESTSOCK6="$PERL $TOP/bin/tests/system/testsock6.pl"
+               $PERL "$TOP/bin/tests/system/testsock6.pl" "$@"
        else
-               TESTSOCK6=false
+               false
        fi
-else
-       TESTSOCK6=false
-fi
-
-if grep "^#define WANT_IPV6 1" $TOP/config.h > /dev/null 2>&1 ; then
-       TESTSOCK6="$TESTSOCK6"
-else
-       TESTSOCK6=false
-fi
+}
 
 #
 # PsSuspend is part of PSTools and can be downloaded from
@@ -441,4 +434,3 @@ export RRCHECKER
 export SAMPLEUPDATE
 export SIGNER
 export SUBDIRS
-export TESTSOCK6
index e336077d559f452f059982e3449b6f250401058c..ef8a7a1eaed2e7276eecf3c738966193f087774b 100644 (file)
@@ -238,7 +238,7 @@ if [ -x "$DIG" ] ; then
 
   n=`expr $n + 1`
   echo_i "checking dig @IPv6addr -4 A a.example ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null
+  if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null
   then
     ret=0
     $DIG $DIGOPTS +tcp @fd92:7065:b8e:ffff::2 -4 A a.example > dig.out.test$n 2>&1 && ret=1
@@ -251,7 +251,7 @@ if [ -x "$DIG" ] ; then
 
   n=`expr $n + 1`
   echo_i "checking dig @IPv4addr -6 +mapped A a.example ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null && [ `uname -s` != "OpenBSD" ]
+  if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null && [ "`uname -s`" != "OpenBSD" ]
   then
     ret=0
     ret=0
@@ -265,7 +265,7 @@ if [ -x "$DIG" ] ; then
 
   n=`expr $n + 1`
   echo_i "checking dig +tcp @IPv4addr -6 +nomapped A a.example ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null
+  if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null
   then
     ret=0
     ret=0
@@ -279,7 +279,7 @@ if [ -x "$DIG" ] ; then
   n=`expr $n + 1`
 
   echo_i "checking dig +notcp @IPv4addr -6 +nomapped A a.example ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::2 2>/dev/null
+  if testsock6 fd92:7065:b8e:ffff::2 2>/dev/null
   then
     ret=0
     ret=0
@@ -628,7 +628,7 @@ if [ -x ${DELV} ] ; then
 
   n=`expr $n + 1`
   echo_i "checking delv with IPv6 on IPv4 does not work ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::3 2>/dev/null
+  if testsock6 fd92:7065:b8e:ffff::3 2>/dev/null
   then
     ret=0
     # following should fail because @IPv4 overrides earlier @IPv6 above
@@ -646,7 +646,7 @@ if [ -x ${DELV} ] ; then
 
   n=`expr $n + 1`
   echo_i "checking delv with IPv4 on IPv6 does not work ($n)"
-  if $TESTSOCK6 fd92:7065:b8e:ffff::3 2>/dev/null
+  if testsock6 fd92:7065:b8e:ffff::3 2>/dev/null
   then
     ret=0
     # following should fail because @IPv6 overrides earlier @IPv4 above
index 16a9332518c9aac6497e34f3c1de1024d70e89a8..295657405b3a0532af45050d7cd896d68c77792f 100644 (file)
@@ -169,7 +169,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is returned when both AAAA and A record exists, unsigned over IPv6 ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::1
+if testsock6 fd92:7065:b8e:ffff::1
 then
 ret=0
 $DIG $DIGOPTS aaaa dual.unsigned -b fd92:7065:b8e:ffff::1 @fd92:7065:b8e:ffff::1 > dig.out.ns1.test$n || ret=1
@@ -210,7 +210,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, over IPv6 ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::1
+if testsock6 fd92:7065:b8e:ffff::1
 then
 ret=0
 $DIG $DIGOPTS +add +dnssec mx unsigned -b fd92:7065:b8e:ffff::1 @fd92:7065:b8e:ffff::1 > dig.out.ns1.test$n || ret=1
@@ -344,7 +344,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is returned when both AAAA and A record exists, unsigned over IPv6 with break-dnssec ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::4
+if testsock6 fd92:7065:b8e:ffff::4
 then
 ret=0
 $DIG $DIGOPTS aaaa dual.unsigned -b fd92:7065:b8e:ffff::4 @fd92:7065:b8e:ffff::4 > dig.out.ns4.test$n || ret=1
@@ -382,7 +382,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, over IPv6, with break-dnssec ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::4
+if testsock6 fd92:7065:b8e:ffff::4
 then
 ret=0
 $DIG $DIGOPTS +add +dnssec mx unsigned -b fd92:7065:b8e:ffff::4 @fd92:7065:b8e:ffff::4 > dig.out.ns4.test$n || ret=1
@@ -511,7 +511,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is returned when both AAAA and A record exists, unsigned over IPv6, recursive ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::2
+if testsock6 fd92:7065:b8e:ffff::2
 then
 ret=0
 $DIG $DIGOPTS aaaa dual.unsigned -b fd92:7065:b8e:ffff::2 @fd92:7065:b8e:ffff::2 > dig.out.ns2.test$n || ret=1
@@ -548,8 +548,8 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
 n=`expr $n + 1`
-echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, over IPv6 ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::2
+echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, recursive, over IPv6 ($n)"
+if testsock6 fd92:7065:b8e:ffff::2
 then
 ret=0
 $DIG $DIGOPTS +add +dnssec mx unsigned -b fd92:7065:b8e:ffff::2 @fd92:7065:b8e:ffff::2 > dig.out.ns2.test$n || ret=1
@@ -678,7 +678,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is returned when both AAAA and A record exists, unsigned over IPv6, recursive with break-dnssec ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
 ret=0
 $DIG $DIGOPTS aaaa dual.unsigned -b fd92:7065:b8e:ffff::3 @fd92:7065:b8e:ffff::3 > dig.out.ns3.test$n || ret=1
@@ -716,7 +716,7 @@ status=`expr $status + $ret`
 
 n=`expr $n + 1`
 echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, over IPv6, recursive with break-dnssec ($n)"
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
 ret=0
 $DIG $DIGOPTS +add +dnssec mx unsigned -b fd92:7065:b8e:ffff::3 @fd92:7065:b8e:ffff::3 > dig.out.ns3.test$n || ret=1
@@ -727,11 +727,12 @@ else
 echo_i "skipped."
 fi
 
-$TESTSOCK6 fd92:7065:b8e:ffff::1 || {
-        echo_i "IPv6 address not configured; skipping IPv6 query tests"
-        echo_i "exit status: $status"
-        exit $status
-}
+if ! testsock6 fd92:7065:b8e:ffff::1
+then
+       echo_i "IPv6 address not configured; skipping IPv6 query tests"
+       echo_i "exit status: $status"
+       exit $status
+fi
 
 # Reconfiguring for IPv6 tests
 echo_i "reconfiguring servers"
index d9e03792f75df83c70d3d73675a8372a309c766a..0867c8cc9d2602e13317829d6f561250fbd49ae7 100644 (file)
@@ -156,7 +156,7 @@ copy_setports ns2/named6.conf.in ns2/named.conf
 $RNDCCMD 10.53.0.2 reload 2>&1 | sed 's/^/ns2 /' | cat_i
 sleep 3
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking GeoIP city database by city name using IPv6 ($n)"
@@ -466,7 +466,7 @@ ret=0
 $DIG $DIGOPTS -4 txt example -b 10.53.0.2 > dig.out.ns2.test$n.1 || ret=1
 j=`cat dig.out.ns2.test$n.1 | tr -d '"'`
 [ "$j" = "bogus" ] || ret=1
-if $TESTSOCK6 fd92:7065:b8e:ffff::2; then
+if testsock6 fd92:7065:b8e:ffff::2; then
     $DIG $DIGOPTS6 txt example -b fd92:7065:b8e:ffff::2 > dig.out.ns2.test$n.2 || ret=1
     j=`cat dig.out.ns2.test$n.2 | tr -d '"'`
     [ "$j" = "2" ] || ret=1
index d2e1022ab854dff62b3e4419d99f5f99d4249bc9..d94fba62ad8c324148c955ca5c6276ac3500899f 100644 (file)
@@ -55,7 +55,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking Country database by code using IPv6 ($n)"
@@ -94,7 +94,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking Country database with nested ACLs using IPv6 ($n)"
@@ -133,7 +133,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking Country database by name using IPv6 ($n)"
@@ -173,7 +173,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking Country database by continent code using IPv6 ($n)"
@@ -214,7 +214,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking City database by region code using IPv6 ($n)"
@@ -255,7 +255,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking City database by city name using IPv6 ($n)"
@@ -294,7 +294,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking ISP database using IPv6 ($n)"
@@ -333,7 +333,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking ASN database by org name using IPv6 ($n)"
@@ -372,7 +372,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking ASN database, ASNNNN only, using IPv6 ($n)"
@@ -411,7 +411,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking ASN database, NNNN only, using IPv6 ($n)"
@@ -450,7 +450,7 @@ done
 [ $ret -eq 0 ] || echo_i "failed"
 status=`expr $status + $ret`
 
-if $TESTSOCK6 fd92:7065:b8e:ffff::3
+if testsock6 fd92:7065:b8e:ffff::3
 then
   n=`expr $n + 1`
   echo_i "checking Domain database using IPv6 ($n)"
index 95cad164f43896172d4365ec35d4b12485161400..a8e2e9efff745ef2cc20c2f9eb5b74fc11f5821b 100755 (executable)
@@ -160,7 +160,7 @@ n=`expr $n + 1`
 # Note: for a short term workaround we use ::1, assuming it's configured and
 # usable for our tests.  We should eventually use the test ULA and available
 # checks introduced in change 2916.
-if $TESTSOCK6 ../testsock6.pl ::1 2> /dev/null
+if testsock6 ::1
 then
     echo_i "checking IPv6 static-stub address ($n)"
     ret=0