summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/galera/include/galera_have_debug_sync.inc2
-rw-r--r--mysql-test/suite/galera/include/have_mariabackup.inc7
-rw-r--r--mysql-test/suite/galera/suite.pm19
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup.cnf3
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf3
-rw-r--r--mysql-test/suite/galera_3nodes/include/galera_resume.inc9
-rw-r--r--mysql-test/suite/galera_3nodes/include/have_garbd.inc3
-rw-r--r--mysql-test/suite/galera_3nodes/suite.pm13
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test2
-rw-r--r--mysql-test/suite/galera_sr/suite.pm67
-rw-r--r--mysql-test/suite/mariabackup/suite.pm3
-rw-r--r--mysql-test/suite/wsrep/common.pm117
-rw-r--r--mysql-test/suite/wsrep/suite.pm13
13 files changed, 231 insertions, 30 deletions
diff --git a/mysql-test/suite/galera/include/galera_have_debug_sync.inc b/mysql-test/suite/galera/include/galera_have_debug_sync.inc
index 7c0156052d8..21e7b3c88c3 100644
--- a/mysql-test/suite/galera/include/galera_have_debug_sync.inc
+++ b/mysql-test/suite/galera/include/galera_have_debug_sync.inc
@@ -3,7 +3,7 @@
--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'`
--if (!$galera_have_debug_sync) {
- --skip "Test requires Galera debug library with debug_sync functionality"
+ --skip Test requires Galera debug library with debug_sync functionality
}
--enable_query_log
diff --git a/mysql-test/suite/galera/include/have_mariabackup.inc b/mysql-test/suite/galera/include/have_mariabackup.inc
new file mode 100644
index 00000000000..6c4ad240172
--- /dev/null
+++ b/mysql-test/suite/galera/include/have_mariabackup.inc
@@ -0,0 +1,7 @@
+if (!$XTRABACKUP) {
+ skip Needs mariabackup;
+}
+
+if (!$MTR_GALERA_TFMT) {
+ skip Needs socat or nc;
+}
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index cc35f65423c..4b498225227 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -1,16 +1,11 @@
package My::Suite::Galera;
-use File::Basename;
-use My::Find;
-@ISA = qw(My::Suite);
-
-return "Not run for embedded server" if $::opt_embedded_server;
-
-return "WSREP is not compiled in" if not ::have_wsrep();
+use lib 'suite';
+use wsrep::common;
-return "No wsrep provider library" unless ::have_wsrep_provider();
+@ISA = qw(My::Suite);
-return ::wsrep_version_message() unless ::check_wsrep_version();
+return wsrep_not_ok() if wsrep_not_ok();
push @::global_suppressions,
(
@@ -68,4 +63,10 @@ push @::global_suppressions,
qr|WSREP: Sending JOIN failed: -107 \(Transport endpoint is not connected\). Will retry in new primary component.|,
);
+sub skip_combinations {
+ my %skip = ();
+ $skip{'include/have_mariabackup.inc'} = 'Need ss' unless `ss -V`;
+ %skip;
+}
+
bless { };
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
index 75dff78149d..2392071ccfe 100644
--- a/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup.cnf
@@ -10,3 +10,6 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+streamfmt=xbstream
diff --git a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
index 1542376b2b8..e98f37654cc 100644
--- a/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_mariabackup_innodb_flush_logs.cnf
@@ -12,3 +12,6 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true'
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+streamfmt=xbstream
diff --git a/mysql-test/suite/galera_3nodes/include/galera_resume.inc b/mysql-test/suite/galera_3nodes/include/galera_resume.inc
new file mode 100644
index 00000000000..af8f2b956fd
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/include/galera_resume.inc
@@ -0,0 +1,9 @@
+--echo Resuming node ...
+--perl
+ my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'};
+ my $mysqld_pid = `cat $pid_filename`;
+ chomp($mysqld_pid);
+ system("kill -SIGCONT $mysqld_pid");
+ exit(0);
+EOF
+
diff --git a/mysql-test/suite/galera_3nodes/include/have_garbd.inc b/mysql-test/suite/galera_3nodes/include/have_garbd.inc
new file mode 100644
index 00000000000..560372c22e9
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/include/have_garbd.inc
@@ -0,0 +1,3 @@
+if (!$MTR_GARBD_EXE) {
+ skip Needs garbd;
+}
diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
index 4a861f3b9fa..b808db6a50a 100644
--- a/mysql-test/suite/galera_3nodes/suite.pm
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -1,16 +1,11 @@
package My::Suite::GALERA_3NODES;
-use File::Basename;
-use My::Find;
-@ISA = qw(My::Suite);
-
-return "Not run for embedded server" if $::opt_embedded_server;
+use lib 'suite';
+use wsrep::common;
-return "WSREP is not compiled in" if not ::have_wsrep();
-
-return "No wsrep provider library" unless ::have_wsrep_provider();
+@ISA = qw(My::Suite);
-return ::wsrep_version_message() unless ::check_wsrep_version();
+return wsrep_not_ok() if wsrep_not_ok();
push @::global_suppressions,
(
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 8dfb4660f3e..cd5c020ae38 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 include/have_mariabackup.inc
+--source suite/galera/include/have_mariabackup.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
diff --git a/mysql-test/suite/galera_sr/suite.pm b/mysql-test/suite/galera_sr/suite.pm
new file mode 100644
index 00000000000..cc13421d66d
--- /dev/null
+++ b/mysql-test/suite/galera_sr/suite.pm
@@ -0,0 +1,67 @@
+package My::Suite::Galera_sr;
+
+use lib 'suite';
+use wsrep::common;
+
+@ISA = qw(My::Suite);
+
+return wsrep_not_ok() if wsrep_not_ok();
+
+push @::global_suppressions,
+ (
+ qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1),
+ qr(WSREP: Could not open saved state file for reading: .*),
+ qr(WSREP: Could not open state file for reading: .*),
+ qr(WSREP: Gap in state sequence. Need state transfer.),
+ qr(WSREP: Failed to prepare for incremental state transfer:),
+ qr(WSREP:.*down context.*),
+ qr(WSREP: Failed to send state UUID:),
+ qr(WSREP: last inactive check more than .* skipping check),
+ qr(WSREP: Releasing seqno [0-9]* before [0-9]* was assigned.),
+ qr|WSREP: access file\(.*gvwstate.dat\) failed\(No such file or directory\)|,
+ qr(WSREP: Quorum: No node with complete state),
+ qr(WSREP: Initial position was provided by configuration or SST, avoiding override),
+ qr|WSREP: discarding established \(time wait\) .*|,
+ qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.),
+ qr(WSREP: evs::proto.*),
+ qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|,
+ qr(WSREP: no nodes coming from prim view, prim not possible),
+ qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable),
+ qr(WSREP: user message in state LEAVING),
+ qr(WSREP: .* sending install message failed: Transport endpoint is not connected),
+ qr(WSREP: .* sending install message failed: Resource temporarily unavailable),
+ qr(WSREP: Maximum writeset size exceeded by .*),
+ qr(WSREP: transaction size exceeded.*),
+ qr(WSREP: RBR event .*),
+ qr(WSREP: Ignoring error for TO isolated action: .*),
+ qr(WSREP: transaction size limit .*),
+ qr(WSREP: rbr write fail, .*),
+ qr(WSREP: .*Backend not supported: foo.*),
+ qr(WSREP: .*Failed to initialize backend using .*),
+ qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*),
+ qr(WSREP: gcs connect failed: Socket type not supported),
+ qr(WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 .*),
+ qr(WSREP: .*Failed to open backend connection: -110 .*),
+ qr(WSREP: .*Failed to open channel 'my_wsrep_cluster' at .*),
+ qr(WSREP: gcs connect failed: Connection timed out),
+ qr|WSREP: wsrep::connect\(.*\) failed: 7|,
+ qr(WSREP: SYNC message from member .* in non-primary configuration. Ignored.),
+ qr(WSREP: Could not find peer:),
+ qr(WSREP: TO isolation failed for: .*),
+ qr|WSREP: gcs_caused\(\) returned .*|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|,
+ qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|,
+ qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|,
+ qr(WSREP: Action message in non-primary configuration from member [0-9]*),
+ qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*),
+ qr(WSREP: discarding established .*),
+ qr|WSREP: .*core_handle_uuid_msg.*|,
+ qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
+ qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|,
+ qr|Query apply failed:*|,
+ qr(WSREP: Ignoring error*),
+ qr(WSREP: Failed to remove page file .*),
+ qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*),
+ );
+
+bless { };
diff --git a/mysql-test/suite/mariabackup/suite.pm b/mysql-test/suite/mariabackup/suite.pm
index 14e38d16158..f0db4482156 100644
--- a/mysql-test/suite/mariabackup/suite.pm
+++ b/mysql-test/suite/mariabackup/suite.pm
@@ -7,12 +7,13 @@ use strict;
return "Not run for embedded server" if $::opt_embedded_server;
-return "No mariabackup" unless ::have_mariabackup();
+return "No mariabackup" unless $ENV{XTRABACKUP};
my $have_qpress = index(`qpress 2>&1`,"Compression") > 0;
sub skip_combinations {
my %skip;
+ $skip{'include/have_file_key_management.inc'} = 'needs file_key_management plugin' unless $ENV{FILE_KEY_MANAGEMENT_SO};
$skip{'compress_qpress.test'}= 'needs qpress executable in PATH' unless $have_qpress;
%skip;
}
diff --git a/mysql-test/suite/wsrep/common.pm b/mysql-test/suite/wsrep/common.pm
new file mode 100644
index 00000000000..8ac3b3ea94c
--- /dev/null
+++ b/mysql-test/suite/wsrep/common.pm
@@ -0,0 +1,117 @@
+package wsrep::common;
+
+use base qw(Exporter);
+our @EXPORT= qw(wsrep_not_ok);
+
+use File::Basename;
+use Memoize;
+memoize 'wrong_wsrep_version';
+memoize 'check_garbd_support';
+memoize 'check_wsrep_support';
+memoize 'wsrep_not_ok';
+
+use mtr_report;
+
+my $extra_path;
+my $mariabackup_path;
+my $mariabackup_exe;
+my $garbd_exe;
+my $file_wsrep_provider;
+
+sub wrong_wsrep_version() {
+ my $check_version= dirname($My::SafeProcess::safe_process_cmd[0]) . '/wsrep_check_version';
+ my $checked = `$check_version -p`;
+ chomp($checked);
+ return $? ? $checked : undef;
+}
+
+sub which($) { return `sh -c "command -v $_[0]"` }
+
+sub check_garbd_support() {
+ my $wsrep_path= dirname($file_wsrep_provider);
+ $garbd_exe= ::mtr_file_exists($wsrep_path."/garb/garbd",
+ $wsrep_path."/../../bin/garb/garbd",
+ '/usr/bin/garbd');
+ $ENV{MTR_GARBD_EXE}= $garbd_exe if $garbd_exe;
+}
+
+sub check_wsrep_support() {
+ mtr_report(" - binaries built with wsrep patch");
+
+ # ADD scripts to $PATH to that wsrep_sst_* can be found
+ my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir;
+ mtr_error("No SST scripts") unless $spath;
+ $ENV{PATH}="$spath:$ENV{PATH}";
+
+ # ADD mysql client library path to path so that wsrep_notify_cmd can find mysql
+ # client for loading the tables. (Don't assume each machine has mysql install)
+ my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir;
+ mtr_error("No scritps") unless $cpath;
+ $ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath;
+
+ # ADD my_print_defaults script path to path so that SST scripts can find it
+ my $my_print_defaults_exe=
+ ::mtr_exe_maybe_exists(
+ "$::bindir/extra/my_print_defaults",
+ "$::path_client_bindir/my_print_defaults");
+ my $epath= "";
+ if ($my_print_defaults_exe ne "") {
+ $epath= dirname($my_print_defaults_exe);
+ }
+ mtr_error("No my_print_defaults") unless $epath;
+ $ENV{PATH}="$epath:$ENV{PATH}" unless ($epath eq $spath) or
+ ($epath eq $cpath);
+
+ $extra_path= $epath;
+
+ if (which("socat")) {
+ $ENV{MTR_GALERA_TFMT}="socat";
+ } elsif (which("nc")) {
+ $ENV{MTR_GALERA_TFMT}="nc";
+ }
+
+ $ENV{PATH}=dirname($ENV{XTRABACKUP}).":$ENV{PATH}" if $ENV{XTRABACKUP};
+
+ # Check whether WSREP_PROVIDER environment variable is set.
+ if (defined $ENV{'WSREP_PROVIDER'}) {
+ $file_wsrep_provider= "";
+ if ($ENV{'WSREP_PROVIDER'} ne "none") {
+ if (::mtr_file_exists($ENV{'WSREP_PROVIDER'}) ne "") {
+ $file_wsrep_provider= $ENV{'WSREP_PROVIDER'};
+ } else {
+ mtr_error("WSREP_PROVIDER env set to an invalid path");
+ }
+ check_garbd_support();
+ }
+ # WSREP_PROVIDER is valid; set to a valid path or "none").
+ mtr_verbose("WSREP_PROVIDER env set to $ENV{'WSREP_PROVIDER'}");
+ } else {
+ # WSREP_PROVIDER env not defined. Lets try to locate the wsrep provider
+ # library.
+ $file_wsrep_provider=
+ ::mtr_file_exists("/usr/lib64/galera-4/libgalera_smm.so",
+ "/usr/lib64/galera/libgalera_smm.so",
+ "/usr/lib/galera-4/libgalera_smm.so",
+ "/usr/lib/galera/libgalera_smm.so");
+ if ($file_wsrep_provider ne "") {
+ # wsrep provider library found !
+ mtr_verbose("wsrep provider library found : $file_wsrep_provider");
+ $ENV{'WSREP_PROVIDER'}= $file_wsrep_provider;
+ check_garbd_support();
+ } else {
+ mtr_verbose("Could not find wsrep provider library, setting it to 'none'");
+ $ENV{'WSREP_PROVIDER'}= "none";
+ }
+ }
+}
+
+sub wsrep_not_ok() {
+ return "Not run for embedded server" if $::opt_embedded_server;
+ return "WSREP is not compiled in" if not $::mysqld_variables{'wsrep-on'};
+ check_wsrep_support();
+ return "No wsrep provider library" unless $file_wsrep_provider;
+ return wrong_wsrep_version() if wrong_wsrep_version();
+ undef;
+}
+
+1;
diff --git a/mysql-test/suite/wsrep/suite.pm b/mysql-test/suite/wsrep/suite.pm
index 7b3dae7c8c3..2ee33d83275 100644
--- a/mysql-test/suite/wsrep/suite.pm
+++ b/mysql-test/suite/wsrep/suite.pm
@@ -1,16 +1,11 @@
package My::Suite::WSREP;
-use File::Basename;
-use My::Find;
-@ISA = qw(My::Suite);
-
-return "Not run for embedded server" if $::opt_embedded_server;
+use lib 'suite';
+use wsrep::common;
-return "WSREP is not compiled in" unless ::have_wsrep();
-
-return "No wsrep provider library" unless ::have_wsrep_provider();
+@ISA = qw(My::Suite);
-return ::wsrep_version_message() unless ::check_wsrep_version();
+return wsrep_not_ok() if wsrep_not_ok();
push @::global_suppressions,
(