TESTSOCK6=false
fi
+if grep "^#define WANT_IPV6 1" $TOP/config.h > /dev/null 2>&1 ; then
+ TESTSOCK6="$TESTSOCK6"
+else
+ TESTSOCK6=false
+fi
+
+
PYTHON=@PYTHON@
#
grep "^weeks.example. 1814400" < 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
+ $DIG $DIGOPTS +tcp @10.53.0.2 -4 -6 A a.example > dig.out.test$n 2>&1 && ret=1
+ grep "only one of -4 and -6 allowed" < 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 @IPv6addr -4 A a.example ($n)"
+ if $TESTSOCK6 fd92:7065:b8e:ffff::2
+ then
+ ret=0
+ $DIG $DIGOPTS +tcp @fd92:7065:b8e:ffff::2 -4 A a.example > dig.out.test$n 2>&1 && ret=1
+ grep "address family not supported" < dig.out.test$n > /dev/null || ret=1
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+ else
+ echo "I:IPv6 unavailable; skipping"
+ fi
+
+ n=`expr $n + 1`
+ echo "I:checking dig @IPv4addr -6 A a.example ($n)"
+ if $TESTSOCK6 fd92:7065:b8e:ffff::2
+ then
+ ret=0
+ ret=0
+ $DIG $DIGOPTS +tcp @10.53.0.2 -6 A a.example > dig.out.test$n 2>&1 || ret=1
+ grep "SERVER: ::ffff:10.53.0.2#5300" < dig.out.test$n > /dev/null || ret=1
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+ else
+ echo "I:IPv6 unavailable; skipping"
+ fi
+
+ n=`expr $n + 1`
+ echo "I:checking dig +subnet ($n)"
+ ret=0
+ $DIG $DIGOPTS +tcp @10.53.0.2 +subnet=127.0.0.1 A a.example > dig.out.test$n 2>&1 || ret=1
+ grep "CLIENT-SUBNET: 127.0.0.1/32/0" < 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 +sp works as an abbriviated form of split ($n)"
+ ret=0
+ $DIG $DIGOPTS @10.53.0.3 +sp=4 -t sshfp foo.example > dig.out.test$n || ret=1
+ grep " 9ABC DEF6 7890 " < 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 -c works ($n)"
+ ret=0
+ $DIG $DIGOPTS @10.53.0.3 -c CHAOS -t txt version.bind > dig.out.test$n || ret=1
+ grep "version.bind. 0 CH TXT" < dig.out.test$n > /dev/null || ret=1
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
else
echo "$DIG is needed, so skipping these dig tests"
test "${f:-0}" -eq 4 || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
+
+ n=`expr $n + 1`
+ echo "I:checking delv +sp works as an abbriviated form of split ($n)"
+ ret=0
+ $DELV $DELVOPTS @10.53.0.3 +sp=4 -t sshfp foo.example > delv.out.test$n || ret=1
+ grep " 9ABC DEF6 7890 " < delv.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 delv +sh works as an abbriviated form of short ($n)"
+ ret=0
+ $DELV $DELVOPTS @10.53.0.3 +sh a a.example > delv.out.test$n || ret=1
+ if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
+
+ n=`expr $n + 1`
+ echo "I:checking delv -c IN works ($n)"
+ ret=0
+ $DELV $DELVOPTS @10.53.0.3 -c IN -t a a.example > delv.out.test$n || ret=1
+ grep "a.example." < delv.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 delv -c CH is ignored, and treated like IN ($n)"
+ ret=0
+ $DELV $DELVOPTS @10.53.0.3 -c CH -t a a.example > delv.out.test$n || ret=1
+ grep "a.example." < delv.out.test$n > /dev/null || ret=1
+ if [ $ret != 0 ]; then echo "I:failed"; fi
+ status=`expr $status + $ret`
exit $status
else
grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -eq 26 ] || ret=1
+if $TESTSOCK6 != false
+then
+ [ $count -eq 26 ] || { ret=1; echo "I: count ($count) != 26"; }
+else
+ [ $count -eq 14 ] || { ret=1; echo "I: count ($count) != 14"; }
+fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -eq 49 ] || ret=1
+if $TESTSOCK6 != false
+then
+ [ $count -eq 49 ] || { ret=1; echo "I: count ($count) != 49"; }
+else
+ [ $count -eq 26 ] || { ret=1; echo "I: count ($count) != 26"; }
+fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -eq 12 ] || ret=1
+if $TESTSOCK6 != false
+then
+ [ $count -eq 12 ] || { ret=1; echo "I: count ($count) != 12"; }
+else
+ [ $count -eq 7 ] || { ret=1; echo "I: count ($count) != 7"; }
+fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -eq 21 ] || ret=1
+if $TESTSOCK6 != false
+then
+ [ $count -eq 21 ] || { ret=1; echo "I: count ($count) != 21"; }
+else
+ [ $count -eq 12 ] || { ret=1; echo "I: count ($count) != 12"; }
+fi
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.3 indirect5.example.org > dig.out.1.test$n || ret=1
-grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
+if $TESTSOCK6 != false
+then
+ grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
+fi
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -le 50 ] || ret=1
+[ $count -le 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -le 50 ] || ret=1
+[ $count -le 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush 2>&1 | sed 's/^/I:ns1 /'
$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
$DIG $DIGOPTS @10.53.0.3 indirect7.example.org > dig.out.1.test$n || ret=1
-grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
+if $TESTSOCK6 != false
+then
+ grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
+fi
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -le 40 ] || ret=1
+[ $count -le 40 ] || { ret=1; echo "I: count ($count) !<= 40"; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
grep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
eval count=`cat dig.out.2.test$n`
-[ $count -le 40 ] || ret=1
+[ $count -le 40 ] || { ret=1; echo "I: count ($count) !<= 40"; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
[ $count -lt 50 ] || ret=1
$DIG $DIGOPTS +short @10.53.0.7 count txt > dig.out.3.test$n || ret=1
eval count=`cat dig.out.3.test$n`
-[ $count -lt 50 ] || ret=1
+[ $count -lt 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
# 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 $PERL ../testsock6.pl ::1 2> /dev/null
+if $TESTSOCK6 ../testsock6.pl ::1 2> /dev/null
then
echo "I:checking IPv6 static-stub address ($n)"
ret=0
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id$ */
-
/*! \file */
#include <config.h>
#include <unistd.h>
#include <time.h>
+#include <isc/platform.h>
#include <isc/socket.h>
#include <isc/print.h>
atf_tc_set_md_var(tc, "descr", "udp dscp ipv6");
}
ATF_TC_BODY(udp_dscp_v6, tc) {
+#if defined(ISC_PLATFORM_HAVEIPV6) && defined(WANT_IPV6)
isc_result_t result;
isc_sockaddr_t addr1, addr2;
struct in6_addr in6;
isc_socket_detach(&s2);
isc_test_end();
+#else
+ UNUSED(tc);
+ atf_tc_skip("IPv6 not available");
+#endif
}
/* Test TCP sendto/recv (IPv4) */
atf_tc_set_md_var(tc, "descr", "tcp dscp ipv6");
}
ATF_TC_BODY(tcp_dscp_v6, tc) {
+#ifdef ISC_PLATFORM_HAVEIPV6
isc_result_t result;
isc_sockaddr_t addr1;
struct in6_addr in6;
isc_socket_detach(&s3);
isc_test_end();
+#else
+ UNUSED(tc);
+ atf_tc_skip("IPv6 not available");
+#endif
}
ATF_TC(net_probedscp);
# if defined(WANT_IPV6)
static isc_once_t once_ipv6only = ISC_ONCE_INIT;
-# endif
-# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
+# if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT;
-# endif
+# endif
+# endif /* WANT_IPV6 */
#endif /* ISC_PLATFORM_HAVEIPV6 */
+#ifndef ISC_CMSG_IP_TOS
+#ifdef __APPLE__
+#define ISC_CMSG_IP_TOS 0 /* As of 10.8.2. */
+#else /* ! __APPLE__ */
+#define ISC_CMSG_IP_TOS 1
+#endif /* ! __APPLE__ */
+#endif /* ! ISC_CMSG_IP_TOS */
+
static isc_once_t once = ISC_ONCE_INIT;
static isc_once_t once_dscp = ISC_ONCE_INIT;
return (ipv6pktinfo_result);
}
+#if ISC_CMSG_IP_TOS || \
+ defined(ISC_NET_BSD44MSGHDR) && defined(IPV6_TCLASS) && defined(WANT_IPV6)
+
static inline ISC_SOCKADDR_LEN_T
cmsg_len(ISC_SOCKADDR_LEN_T len) {
#ifdef CMSG_LEN
return (ISC_TRUE);
}
#endif
+#endif
static void
try_dscp_v4(void) {
#ifdef ISC_NET_BSD44MSGHDR
-#ifndef ISC_CMSG_IP_TOS
-#ifdef __APPLE__
-#define ISC_CMSG_IP_TOS 0 /* As of 10.8.2. */
-#else /* ! __APPLE__ */
-#define ISC_CMSG_IP_TOS 1
-#endif /* ! __APPLE__ */
-#endif /* ! ISC_CMSG_IP_TOS */
-
#if ISC_CMSG_IP_TOS
if (cmsgsend(s, IPPROTO_IP, IP_TOS, res0))
dscp_result |= ISC_NET_DSCPPKTV4;