diff --git a/mysql-test/suite/galera/include/have_xtrabackup.inc b/mysql-test/suite/galera/include/have_xtrabackup.inc new file mode 100644 index 00000000000..0dd693f2c63 --- /dev/null +++ b/mysql-test/suite/galera/include/have_xtrabackup.inc @@ -0,0 +1,4 @@ +# +# suite.pm will make sure that all tests including this file +# will be skipped as needed +# diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index 361743f1243..b7d157186d8 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -1,4 +1,4 @@ -package My::Suite::GALERA; +package My::Suite::Galera; use File::Basename; use My::Find; @@ -25,6 +25,8 @@ return "No scritps" unless $cpath; my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir; return "No my_print_defaults" unless $epath; +sub which($) { return `sh -c "command -v $_[0]"` } + push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), @@ -82,5 +84,19 @@ $ENV{PATH}="$epath:$ENV{PATH}"; $ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath; $ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath; -bless { }; +if (which(socat)) { + $ENV{MTR_GALERA_TFMT}='socat'; +} elsif (which(nc)) { + $ENV{MTR_GALERA_TFMT}='nc'; +} +sub skip_combinations { + my %skip = (); + $skip{'include/have_xtrabackup.inc'} = 'Need innobackupex' + unless which(innobackupex); + $skip{'include/have_xtrabackup.inc'} = 'Need socat or nc' + unless $ENV{MTR_GALERA_TFMT}; + %skip; +} + +bless { }; diff --git a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test index 30ce9bc4ceb..cd7621bfa6e 100644 --- a/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test +++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test @@ -6,6 +6,7 @@ --source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_xtrabackup.inc --connection node_1 --let $connection_id = `SELECT CONNECTION_ID()` diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test index 8b399e77794..c44b0642342 100644 --- a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test +++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test @@ -1,6 +1,7 @@ --source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_xtrabackup.inc --source suite/galera/include/galera_st_disconnect_slave.inc --source suite/galera/include/galera_st_shutdown_slave.inc diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf index 31bd1af07c2..1e29673c0ff 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.cnf @@ -22,3 +22,4 @@ parallel=2 encrypt=1 encrypt-algo=AES256 encrypt-key=4FA92C5873672E20FB163A0BCB2BB4A4 +transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test index 4573f176482..db2b706b6b8 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2-options.test @@ -3,9 +3,9 @@ # Initial SST happens via xtrabackup, so there is not much to do in the body of the test # ---source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_xtrabackup.inc SELECT 1; diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf index 47cb3e02292..0025b259ec5 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf @@ -11,3 +11,5 @@ wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore [mysqld.2] wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' +[sst] +transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test index aac6822170a..f1fd0f3ddf3 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test @@ -1,6 +1,6 @@ ---source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_xtrabackup.inc # Save original auto_increment_offset values. --let $node_1=node_1 diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf index 969516f5f3b..63d05104a37 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.cnf @@ -9,3 +9,4 @@ wsrep_debug=ON tkey=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem tcert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem encrypt=3 +transferfmt=@ENV.MTR_GALERA_TFMT diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test index 24d9589d111..2f685ca7184 100644 --- a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test +++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2_encrypt_with_key.test @@ -6,6 +6,7 @@ --source include/big_test.inc --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_xtrabackup.inc SELECT 1;