Skip to content

Commit 68deb11

Browse files
author
Nirbhay Choubey
committed
Modified mtr script to skip inclusion of 'galera' test suites
if galera library is not specified or found.
1 parent 97d8323 commit 68deb11

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

mysql-test/mysql-test-run.pl

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ BEGIN
135135
my $opt_start_dirty;
136136
my $opt_start_exit;
137137
my $start_only;
138+
my $file_wsrep_provider;
138139

139140
END {
140141
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
@@ -187,8 +188,6 @@ END
187188
sys_vars-
188189
unit-
189190
vcol-
190-
galera-
191-
wsrep-
192191
);
193192
my $opt_suites;
194193

@@ -2405,17 +2404,19 @@ sub environment_setup {
24052404
# ----------------------------------------------------
24062405
if (have_wsrep()) {
24072406
if (defined $ENV{'WSREP_PROVIDER'} ) {
2408-
# Nothing needs to be done! WSREP_PROVIDER env is already set and will be
2409-
# used.
2407+
# Nothing needs to be done! WSREP_PROVIDER env is already set & checked;
2408+
# will be used.
24102409
} else {
2411-
my $file_wsrep_provider=
2412-
mtr_file_exists("/usr/lib/galera/libgalera_smm.so",
2413-
"/usr/lib64/galera/libgalera_smm.so");
24142410
$ENV{'WSREP_PROVIDER'}= $file_wsrep_provider;
24152411
}
2416-
mtr_verbose("WSREP_PROVIDER set to $ENV{'WSREP_PROVIDER'}");
2412+
2413+
if ($ENV{'WSREP_PROVIDER'} ne "") {
2414+
mtr_verbose("WSREP_PROVIDER set to $ENV{'WSREP_PROVIDER'}");
2415+
} else {
2416+
mtr_verbose("WSREP_PROVIDER isn't available");
2417+
}
24172418
}
2418-
2419+
24192420
# ----------------------------------------------------
24202421
# mysql clients
24212422
# ----------------------------------------------------
@@ -3198,10 +3199,33 @@ ()
31983199
return defined $wsrep_on
31993200
}
32003201

3202+
sub check_wsrep_provider_env {
3203+
if (defined $ENV{'WSREP_PROVIDER'}) {
3204+
if (mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") {
3205+
mtr_error("WSREP_PROVIDER env set to an invalid path");
3206+
return 0; # error
3207+
}
3208+
# Ok, WSREP_PROVIDER set to a valid path.
3209+
return 1;
3210+
}
3211+
# Ok, WSREP_PROVIDER not defined.
3212+
return 2;
3213+
}
3214+
32013215
sub check_wsrep_support() {
32023216
if (have_wsrep())
32033217
{
32043218
mtr_report(" - binaries built with wsrep patch");
3219+
3220+
$file_wsrep_provider=
3221+
mtr_file_exists("/usr/lib/galera/libgalera_smm.so",
3222+
"/usr/lib64/galera/libgalera_smm.so");
3223+
3224+
if ((check_wsrep_provider_env() == 1) || ($file_wsrep_provider ne "")) {
3225+
# Add galera test suites
3226+
mtr_report(" - adding wsrep, galera to default test suites");
3227+
push @DEFAULT_SUITES, qw(wsrep galera);
3228+
}
32053229
}
32063230
}
32073231

0 commit comments

Comments
 (0)