1package My::Suite::Main;
2use My::Platform;
3
4@ISA = qw(My::Suite);
5
6sub skip_combinations {
7  my @combinations;
8
9  # disable innodb combinations for configurations that were not built
10  push @combinations, 'innodb_plugin' unless $ENV{HA_INNODB_SO};
11
12  push @combinations, 'innodb' unless $::mysqld_variables{'innodb'} eq "ON";
13
14  my %skip = ( 'include/have_innodb.combinations' => [ @combinations ]);
15
16  $skip{'include/innodb_encrypt_log.combinations'} = [ 'crypt' ]
17                unless $ENV{DEBUG_KEY_MANAGEMENT_SO};
18
19  # don't run tests for the wrong platform
20  if (IS_WINDOWS) {
21    $skip{'include/platform.combinations'} = [ 'aix', 'unix' ];
22  } elsif (IS_AIX) {
23    $skip{'include/platform.combinations'} = [ 'win', 'unix' ];
24  } else {
25    $skip{'include/platform.combinations'} = [ 'aix', 'win' ];
26  }
27
28  $skip{'include/maybe_debug.combinations'} =
29    [ defined $::mysqld_variables{'debug-dbug'} ? 'release' : 'debug' ];
30
31  $skip{'include/have_debug.inc'} = 'Requires debug build'
32             unless defined $::mysqld_variables{'debug-dbug'};
33
34  # and for the wrong word size
35  # check for exact values, in case the default changes to be small everywhere
36  my $longsysvar= $::mysqld_variables{'max-binlog-stmt-cache-size'};
37  my %val_map= (
38    '4294963200' => '64bit', # remember, it shows *what configuration to skip*
39    '18446744073709547520' => '32bit'
40  );
41  die "unknown value max-binlog-stmt-cache-size=$longsysvar" unless $val_map{$longsysvar};
42  $skip{'include/word_size.combinations'} = [ $val_map{$longsysvar} ];
43
44  # as a special case, disable certain include files as a whole
45  $skip{'include/not_embedded.inc'} = 'Not run for embedded server'
46             if $::opt_embedded_server;
47
48  $skip{'include/have_example_plugin.inc'} = 'Need example plugin'
49             unless $ENV{HA_EXAMPLE_SO};
50
51  $skip{'include/not_windows.inc'} = 'Requires not Windows' if IS_WINDOWS;
52  $skip{'include/not_aix.inc'} = 'Requires not AIX' if IS_AIX;
53
54  $skip{'main/plugin_loaderr.test'} = 'needs compiled-in innodb'
55            unless $::mysqld_variables{'innodb'} eq "ON";
56
57  # disable tests that use ipv6, if unsupported
58  sub ipv6_ok() {
59    use Socket;
60    return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp');
61    $!="";
62    # eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14
63    eval { bind $sock, sockaddr_in6($::baseport, Socket::IN6ADDR_LOOPBACK) };
64    return $@ eq "" && $! eq ""
65  }
66  $skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok();
67
68  # SSL is complicated
69  my $ssl_lib= $::mysqld_variables{'version-ssl-library'};
70  my $openssl_ver= $ssl_lib =~ /OpenSSL (\S+)/ ? $1 : "";
71
72  $skip{'include/have_ssl_communication.inc'} =
73  $skip{'include/have_ssl_crypto_functs.inc'} = 'Requires SSL' unless $ssl_lib;
74
75  $skip{'main/openssl_6975.test'} = 'no or wrong openssl version'
76    unless $openssl_ver ge "1.0.1d" and $openssl_ver lt "1.1.1";
77
78  $skip{'main/ssl_7937.combinations'} = [ 'x509v3' ]
79    unless $ssl_lib =~ /WolfSSL/ or $openssl_ver ge "1.0.2";
80
81  $skip{'main/ssl_verify_ip.test'} = 'x509v3 support required'
82    unless $openssl_ver ge "1.0.2";
83
84
85  %skip;
86}
87
88bless { };
89