Skip to content

Commit baed663

Browse files
mkaruzaJan Lindström
authored andcommitted
Fix for galera_3nodes.galera_garbd
Check for garbd executable on different paths. If not found terminate test.
1 parent 7644292 commit baed663

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

mysql-test/suite/galera_3nodes/t/galera_garbd.test

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,33 @@
2929
--source include/wait_condition.inc
3030

3131
--echo Starting garbd ...
32-
--let $gp1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
33-
--let $galera_port_1 = `SELECT SUBSTR('$gp1', 1, LOCATE(';', '$gp1') - 1)`
34-
--exec `dirname $WSREP_PROVIDER`/../../bin/garb/garbd --address "gcomm://127.0.0.1:$galera_port_1" --group my_wsrep_cluster --options 'base_port=$galera_port_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
32+
--perl
33+
use strict;
34+
use File::Basename;
35+
my $provider_dirname = dirname($ENV{WSREP_PROVIDER});
36+
# Array of possible garbd executable paths to be checked
37+
# base is $provider_dirname
38+
my @garbd_executable_search = (
39+
# WSREP_PROVIDER is set in galera repository
40+
${provider_dirname}."/garb/garbd",
41+
# MariaDB (PR #1147)
42+
${provider_dirname}."/../../bin/garb/garbd"
43+
);
44+
my $garbd_executable = '';
45+
foreach my $garbd (@garbd_executable_search) {
46+
if (-f $garbd) {
47+
$garbd_executable= $garbd;
48+
}
49+
}
50+
if ($garbd_executable eq '') {
51+
die("Didn't locate garbd\n");
52+
}
53+
die unless open(FILE, ">$ENV{MYSQLTEST_VARDIR}/tmp/garbd.inc");
54+
print FILE "--exec $garbd_executable --address \"gcomm://127.0.0.1:\$NODE_GALERAPORT_1\" --group my_wsrep_cluster --options 'base_port=\$NODE_GALERAPORT_3' > \$MYSQL_TMP_DIR/garbd.log 2>&1 &\n";
55+
close(FILE);
56+
EOF
57+
--source $MYSQLTEST_VARDIR/tmp/garbd.inc
58+
--remove_file $MYSQLTEST_VARDIR/tmp/garbd.inc
3559

3660
--sleep 5
3761

0 commit comments

Comments
 (0)