1 --source include/not_windows.inc
4 my $MYSQL = $ENV{
'MYSQL'};
5 my $MYSQLADMIN = $ENV{
'MYSQLADMIN'};
6 my $MASTER_MYPORT = $ENV{
'MASTER_MYPORT'};
7 my $MYSQLTEST_VARDIR = $ENV{
'MYSQLTEST_VARDIR'};
8 my $LOG_FILE = $ENV{
'WL6301_LOG_FILE'};
10 my @ipv4_addresses = split (/\
n/, `ifconfig | grep
'inet addr' | sed
's/^.*inet addr://' | sed
's/ .*\$//'`);
11 my @ipv6_addresses = split (/\
n/, `ifconfig | grep
'inet6 addr.*Scope:Global' | sed
's/^.*inet6 addr: //' | sed
's/ .*\$//' | sed
's|/.*\$||'`);
13 push (@ipv6_addresses,
'::1');
15 open (LOGFH,
">$LOG_FILE") or
16 die "Can not open '$LOG_FILE': $!\
n";
20 foreach my $ip (@ipv4_addresses)
22 print LOGFH
"- ipv4: '$ip'\n";
28 "--port=$MASTER_MYPORT " .
31 "-e 'GRANT ALL PRIVILEGES ON test.* TO u1@$ip;'");
33 print LOGFH
" GRANT status: $rc\n";
41 "--port=$MASTER_MYPORT " .
43 "ping > /dev/null 2>&1");
45 print LOGFH
" Connect u1@$ip status: $rc\n";
53 "--port=$MASTER_MYPORT " .
56 "-e 'DROP USER u1@$ip;'");
58 print LOGFH
" DROP USER status: $rc\n";
65 foreach my $ip (@ipv6_addresses)
67 print LOGFH
"- ipv6: '$ip'\n";
73 "--port=$MASTER_MYPORT " .
76 "-e 'GRANT ALL PRIVILEGES ON test.* TO u1@$ip;'");
78 print LOGFH
" GRANT status: $rc\n";
86 "--port=$MASTER_MYPORT " .
88 "ping > /dev/null 2>&1");
90 print LOGFH
" Connect u1@$ip status: $rc\n";
98 "--port=$MASTER_MYPORT " .
101 "-e 'DROP USER u1@$ip;'");
103 print LOGFH
" DROP USER status: $rc\n";
110 unless ($ipv4_failed)
112 print
"IPv4 connectivity: OK\n";
116 print
"IPv4 connectivity: FAIL\n";
119 unless ($ipv6_failed)
121 print
"IPv6 connectivity: OK\n";
125 print
"IPv6 connectivity: FAIL\n";