summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera_3nodes
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2019-07-16 11:33:11 +0200
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2019-07-17 12:54:12 +0200
commit4e02e502f6f9622a84942fd3329241e790acab66 (patch)
tree446ae4e13bba44a962583183f71bb28a786ae324 /mysql-test/suite/galera_3nodes
parent52f6aa1c548b80cb93f9ec49c85adb843f7a5082 (diff)
downloadmariadb-git-4e02e502f6f9622a84942fd3329241e790acab66.tar.gz
MDEV-18565: Galera mtr-suite fails if galera library is not installed
Currently, running mtr with an incorrect (for example, new or obsolete) version of wsrep_provider (for example, with the 26 version of libgalera_smm.so) leads to the failure of tests in several suites with vague error diagnostics. As for the galera_3nodes suite, the mtr also does not effectively check all the prerequisites after merge with MDEV-18426 fixes. For example, tests that using mariabackup do not check for presence of ss and socat/nc. This is due to improper handling of relative paths in mtr scripts. In addition, some tests in different suites can be run without setting the environment variables such as MTR_GALERA_TFMT, XBSTREAM, and so on. To eliminate all these issues, this patch makes the following changes: 1. Added auxiliary wsrep_mtr_check utility (which located in the mysql-test/lib/My/SafeProcess subdirectory), which compares the versions of the wsrep API that used by the server and by the wsrep provider library, and it does this comparison safely, without accessing the API if the versions do not match. 2. All checks related to the presence of mariabackup and utilities that necessary for its operation transferred from the local directories of different mtr suites (from the suite.pm files) to the main suite.pm file. This not only reduces the amount of code and eliminates duplication of identical code fragments, but also avoids problems due to the inability of mtr to consider relative paths to include files when checking skip combinations. 3. Setting the values of auxiliary environment variables that are necessary for Galera, SST scripts and mariabackup (to work properly) is moved to the main mysql-test-run.pl script, so as not to duplicate this code in different suites, and to avoid partial corrections of the same errors for different suites (while other suites remain uncorrected). 4. Fixed duplication of the have_file_key_management.inc and have_filekeymanagement.inc files between different suites, these checks are also transferred to the top level. 5. Added garbd presence check and garbd path variable. https://jira.mariadb.org/browse/MDEV-18565
Diffstat (limited to 'mysql-test/suite/galera_3nodes')
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm51
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_garbd.test3
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test2
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test2
5 files changed, 8 insertions, 52 deletions
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
index a7c1bf79c06..4a861f3b9fa 100644
--- a/mysql-test/suite/galera_3nodes/suite.pm
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -6,30 +6,11 @@ use My::Find;
return "Not run for embedded server" if $::opt_embedded_server;
-return "WSREP is not compiled in" unless defined $::mysqld_variables{'wsrep-on'};
+return "WSREP is not compiled in" if not ::have_wsrep();
-my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
- "/usr/lib64/galera-3/libgalera_smm.so",
- "/usr/lib64/galera/libgalera_smm.so",
- "/usr/lib/galera-3/libgalera_smm.so",
- "/usr/lib/galera/libgalera_smm.so";
+return "No wsrep provider library" unless ::have_wsrep_provider();
-return "No wsrep provider library" unless -f $provider;
-
-$ENV{WSREP_PROVIDER} = $provider;
-
-my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
-return "No SST scripts" unless $spath;
-
-my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir;
-return "No scritps" unless $cpath;
-
-my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
-return "No my_print_defaults" unless $epath;
-
-my ($bpath) = grep { -f "$_/mariabackup"; } "$::bindir/extra/mariabackup", $::path_client_bindir;
-
-sub which($) { return `sh -c "command -v $_[0]"` }
+return ::wsrep_version_message() unless ::check_wsrep_version();
push @::global_suppressions,
(
@@ -65,30 +46,4 @@ push @::global_suppressions,
qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.),
);
-
-$ENV{PATH}="$epath:$ENV{PATH}";
-$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
-$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;
-$ENV{PATH}="$bpath:$ENV{PATH}" unless $bpath eq $spath;
-
-if (which(socat)) {
- $ENV{MTR_GALERA_TFMT}='socat';
-} elsif (which(nc)) {
- $ENV{MTR_GALERA_TFMT}='nc';
-}
-
-sub skip_combinations {
- my %skip = ();
- $skip{'include/have_filekeymanagement.inc'} = 'needs file_key_management plugin'
- unless $ENV{FILE_KEY_MANAGEMENT_SO};
- $skip{'suite/galera/include/have_mariabackup.inc'} = 'Need mariabackup'
- unless which(mariabackup);
- $skip{'suite/galera/include/have_mariabackup.inc'} = 'Need ss'
- unless which(ss);
- $skip{'suite/galera/include/have_mariabackup.inc'} = 'Need socat or nc'
- unless $ENV{MTR_GALERA_TFMT};
- %skip;
-}
-
bless { };
-
diff --git a/mysql-test/suite/galera_3nodes/t/galera_garbd.test b/mysql-test/suite/galera_3nodes/t/galera_garbd.test
index 2d03e8897b9..3992259c732 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_garbd.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_garbd.test
@@ -5,6 +5,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
+--source include/have_garbd.inc
--source include/big_test.inc
--let $galera_connection_name = node_3
@@ -30,7 +31,7 @@
--echo Starting garbd ...
--let $gp1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
--let $galera_port_1 = `SELECT SUBSTR('$gp1', 1, LOCATE(';', '$gp1') - 1)`
---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 &
+--exec $MTR_GARBD_EXE --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 &
--sleep 5
diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
index cd5c020ae38..8dfb4660f3e 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
@@ -4,7 +4,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
---source suite/galera/include/have_mariabackup.inc
+--source include/have_mariabackup.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test
index 84c33251c98..8cbd8cf2454 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test
@@ -1,6 +1,6 @@
--source include/galera_cluster.inc
--source include/check_ipv6.inc
---source suite/galera/include/have_mariabackup.inc
+--source include/have_mariabackup.inc
# Confirm that initial handshake happened over ipv6
diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test
index 95cd1a5bea5..88c399ddb99 100644
--- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test
+++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup_section.test
@@ -1,6 +1,6 @@
--source include/galera_cluster.inc
--source include/check_ipv6.inc
---source suite/galera/include/have_mariabackup.inc
+--source include/have_mariabackup.inc
# Confirm that initial handshake happened over ipv6