Generate ssl arguments only if ssl is supported

parent 4930a27d
...@@ -139,27 +139,37 @@ sub fix_std_data { ...@@ -139,27 +139,37 @@ sub fix_std_data {
return "$basedir/mysql-test/std_data"; return "$basedir/mysql-test/std_data";
} }
sub ssl_supported {
my ($self)= @_;
return $self->{ARGS}->{ssl};
}
sub fix_ssl_ca { sub fix_ssl_ca {
return if !ssl_supported(@_);
my $std_data= fix_std_data(@_); my $std_data= fix_std_data(@_);
return "$std_data/cacert.pem" return "$std_data/cacert.pem"
} }
sub fix_ssl_server_cert { sub fix_ssl_server_cert {
return if !ssl_supported(@_);
my $std_data= fix_std_data(@_); my $std_data= fix_std_data(@_);
return "$std_data/server-cert.pem" return "$std_data/server-cert.pem"
} }
sub fix_ssl_client_cert { sub fix_ssl_client_cert {
return if !ssl_supported(@_);
my $std_data= fix_std_data(@_); my $std_data= fix_std_data(@_);
return "$std_data/client-cert.pem" return "$std_data/client-cert.pem"
} }
sub fix_ssl_server_key { sub fix_ssl_server_key {
return if !ssl_supported(@_);
my $std_data= fix_std_data(@_); my $std_data= fix_std_data(@_);
return "$std_data/server-key.pem" return "$std_data/server-key.pem"
} }
sub fix_ssl_client_key { sub fix_ssl_client_key {
return if !ssl_supported(@_);
my $std_data= fix_std_data(@_); my $std_data= fix_std_data(@_);
return "$std_data/client-key.pem" return "$std_data/client-key.pem"
} }
...@@ -188,9 +198,9 @@ my @mysqld_rules= ...@@ -188,9 +198,9 @@ my @mysqld_rules=
{ 'server-id' => \&fix_server_id, }, { 'server-id' => \&fix_server_id, },
# By default, prevent the started mysqld to access files outside of vardir # By default, prevent the started mysqld to access files outside of vardir
{ 'secure-file-priv' => sub { return shift->{ARGS}->{vardir}; } }, { 'secure-file-priv' => sub { return shift->{ARGS}->{vardir}; } },
{ 'loose-ssl-ca' => \&fix_ssl_ca }, { 'ssl-ca' => \&fix_ssl_ca },
{ 'loose-ssl-cert' => \&fix_ssl_server_cert }, { 'ssl-cert' => \&fix_ssl_server_cert },
{ 'loose-ssl-key' => \&fix_ssl_server_key }, { 'ssl-key' => \&fix_ssl_server_key },
); );
...@@ -268,9 +278,9 @@ my @client_rules= ...@@ -268,9 +278,9 @@ my @client_rules=
# #
my @mysqltest_rules= my @mysqltest_rules=
( (
{ 'loose-ssl-ca' => \&fix_ssl_ca }, { 'ssl-ca' => \&fix_ssl_ca },
{ 'loose-ssl-cert' => \&fix_ssl_client_cert }, { 'ssl-cert' => \&fix_ssl_client_cert },
{ 'loose-ssl-key' => \&fix_ssl_client_key }, { 'ssl-key' => \&fix_ssl_client_key },
); );
......
...@@ -2235,6 +2235,7 @@ sub run_testcase ($) { ...@@ -2235,6 +2235,7 @@ sub run_testcase ($) {
#hosts => [ 'host1', 'host2' ], #hosts => [ 'host1', 'host2' ],
user => $opt_user, user => $opt_user,
password => '', password => '',
ssl => $opt_ssl_supported,
} }
); );
...@@ -3198,10 +3199,6 @@ sub start_mysqltest ($) { ...@@ -3198,10 +3199,6 @@ sub start_mysqltest ($) {
# Turn on SSL for _all_ test cases if option --ssl was used # Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl"); mtr_add_arg($args, "--ssl");
} }
elsif ( $opt_ssl_supported )
{
mtr_add_arg($args, "--skip-ssl");
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# export MYSQL_TEST variable containing <path>/mysqltest <args> # export MYSQL_TEST variable containing <path>/mysqltest <args>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment