From 1b6419f8a7ed988fb17abb3dcc1e628c9e71339d Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 26 Sep 2019 09:56:51 +0200 Subject: [PATCH] digdelv: Extra quotes prevent IPv6 runs 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. --- bin/tests/system/conf.sh.common | 14 +++++--------- bin/tests/system/digdelv/tests.sh | 12 ++++++------ bin/tests/system/filter-aaaa/tests.sh | 27 ++++++++++++++------------- bin/tests/system/geoip2/tests.sh | 22 +++++++++++----------- bin/tests/system/staticstub/tests.sh | 2 +- 5 files changed, 37 insertions(+), 40 deletions(-) diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common index 46eac8a776..5a03d18e88 100644 --- a/bin/tests/system/conf.sh.common +++ b/bin/tests/system/conf.sh.common @@ -9,17 +9,14 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -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 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 +} export LANG=C @@ -491,6 +488,5 @@ export RRCHECKER export SAMPLEUPDATE export SIGNER export SUBDIRS -export TESTSOCK6 export TSIGKEYGEN export WIRETEST diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index 08e4260bf7..8736f66dec 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -310,7 +310,7 @@ if [ -x "$DIG" ] ; then n=$((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_with_opts +tcp @fd92:7065:b8e:ffff::2 -4 A a.example > dig.out.test$n 2>&1 && ret=1 @@ -323,7 +323,7 @@ if [ -x "$DIG" ] ; then n=$((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 dig_with_opts +tcp @10.53.0.2 -6 +mapped A a.example > dig.out.test$n 2>&1 || ret=1 @@ -336,7 +336,7 @@ if [ -x "$DIG" ] ; then n=$((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 dig_with_opts +tcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1 @@ -349,7 +349,7 @@ if [ -x "$DIG" ] ; then n=$((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 dig_with_opts +notcp @10.53.0.2 -6 +nomapped A a.example > dig.out.test$n 2>&1 || ret=1 @@ -860,7 +860,7 @@ if [ -x "$DELV" ] ; then n=$((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 @@ -878,7 +878,7 @@ if [ -x "$DELV" ] ; then n=$((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 diff --git a/bin/tests/system/filter-aaaa/tests.sh b/bin/tests/system/filter-aaaa/tests.sh index ee497b8d29..662c20459e 100644 --- a/bin/tests/system/filter-aaaa/tests.sh +++ b/bin/tests/system/filter-aaaa/tests.sh @@ -166,7 +166,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 @@ -207,7 +207,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 @@ -340,7 +340,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 @@ -378,7 +378,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 @@ -513,7 +513,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 @@ -557,7 +557,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "checking that AAAA is included in additional section, qtype=MX, unsigned, recursive, over IPv6 ($n)" -if $TESTSOCK6 fd92:7065:b8e:ffff::2 +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 @@ -690,7 +690,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 @@ -729,7 +729,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 @@ -740,11 +740,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" diff --git a/bin/tests/system/geoip2/tests.sh b/bin/tests/system/geoip2/tests.sh index 78d04349f3..0b2a9ab6c0 100644 --- a/bin/tests/system/geoip2/tests.sh +++ b/bin/tests/system/geoip2/tests.sh @@ -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)" diff --git a/bin/tests/system/staticstub/tests.sh b/bin/tests/system/staticstub/tests.sh index cda9fe5fca..5cc9dfccbc 100755 --- a/bin/tests/system/staticstub/tests.sh +++ b/bin/tests/system/staticstub/tests.sh @@ -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