@@ -135,6 +135,7 @@ BEGIN
135
135
my $opt_start_dirty ;
136
136
my $opt_start_exit ;
137
137
my $start_only ;
138
+ my $file_wsrep_provider ;
138
139
139
140
END {
140
141
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
187
188
sys_vars-
188
189
unit-
189
190
vcol-
190
- galera-
191
- wsrep-
192
191
) ;
193
192
my $opt_suites ;
194
193
@@ -2405,17 +2404,19 @@ sub environment_setup {
2405
2404
# ----------------------------------------------------
2406
2405
if (have_wsrep()) {
2407
2406
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.
2410
2409
} else {
2411
- my $file_wsrep_provider =
2412
- mtr_file_exists(" /usr/lib/galera/libgalera_smm.so" ,
2413
- " /usr/lib64/galera/libgalera_smm.so" );
2414
2410
$ENV {' WSREP_PROVIDER' }= $file_wsrep_provider ;
2415
2411
}
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
+ }
2417
2418
}
2418
-
2419
+
2419
2420
# ----------------------------------------------------
2420
2421
# mysql clients
2421
2422
# ----------------------------------------------------
@@ -3198,10 +3199,33 @@ ()
3198
3199
return defined $wsrep_on
3199
3200
}
3200
3201
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
+
3201
3215
sub check_wsrep_support () {
3202
3216
if (have_wsrep())
3203
3217
{
3204
3218
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
+ }
3205
3229
}
3206
3230
}
3207
3231
0 commit comments