summaryrefslogtreecommitdiff
path: root/mysql-test/suite.pm
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-17 11:10:18 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-17 11:10:18 +0100
commit3febb3ce1dbf9b5025c29d50f14b7821a648fa66 (patch)
treeda00ba51e0360d7f41c7a585f9294c2d4cbf0017 /mysql-test/suite.pm
parent5f1a2cf8e39bf72316ad694897d59164024d457c (diff)
downloadmariadb-git-3febb3ce1dbf9b5025c29d50f14b7821a648fa66.tar.gz
mtr: smarter check for usable ipv6.
Handles the case of sysctl net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1
Diffstat (limited to 'mysql-test/suite.pm')
-rw-r--r--mysql-test/suite.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index 1c2f55660c2..ef0325bd3e7 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -30,10 +30,14 @@ sub skip_combinations {
unless $::mysqld_variables{'innodb'} eq "ON";
# disable tests that use ipv6, if unsupported
- use Socket;
- $skip{'include/check_ipv6.inc'} = 'No IPv6'
- unless socket SOCK, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
- close SOCK;
+ sub ipv6_ok() {
+ use Socket;
+ return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
+ # eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation
+ eval { connect $sock, sockaddr_in6(7, Socket::IN6ADDR_LOOPBACK) };
+ return $! != 101;
+ }
+ $skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
%skip;
}