Commit 887628ac authored by Nirbhay Choubey's avatar Nirbhay Choubey

Test changes (backported from 10.1).

parent abf400e8
......@@ -238,9 +238,6 @@ my @mysqld_rules=
{ 'pid-file' => \&fix_pidfile },
{ '#host' => \&fix_host },
{ 'port' => \&fix_port },
# galera base_port and port used during SST
{ '#galera_port' => \&fix_port },
{ '#sst_port' => \&fix_port },
{ 'socket' => \&fix_socket },
{ '#log-error' => \&fix_log_error },
{ 'general-log' => 1 },
......
......@@ -862,8 +862,6 @@ sub collect_one_test_case {
# Suite has no config, autodetect which one to use
if ($tinfo->{rpl_test}) {
$config= "suite/rpl/my.cnf";
} elsif ($tinfo->{galera_test}) {
$config= "suite/galera/my.cnf";
} else {
$config= "include/default_my.cnf";
}
......@@ -984,7 +982,6 @@ my $tags_map= {'big_test' => ['big_test', 1],
'master-slave' => ['rpl_test', 1],
'ndb_master-slave' => ['rpl_test', 1, 'ndb_test', 1],
'long_test' => ['long_test', 1],
'galera_init' => ['galera_test', 1],
};
my $tags_regex_string= join('|', keys %$tags_map);
my $tags_regex= qr:include/($tags_regex_string)\.inc:o;
......
......@@ -136,6 +136,8 @@ my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
our @global_suppressions;
END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{
......@@ -187,6 +189,8 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
wsrep-
galera-
);
my $opt_suites;
......@@ -412,7 +416,6 @@ sub main {
check_ndbcluster_support();
check_ssl_support();
check_debug_support();
check_wsrep_support();
if (!$opt_suites) {
$opt_suites= join ',', collect_default_suites(@DEFAULT_SUITES);
......@@ -3175,50 +3178,6 @@ sub ndbcluster_start ($) {
return 0;
}
sub have_wsrep() {
my $wsrep_on= $mysqld_variables{'wsrep-on'};
return defined $wsrep_on
}
sub check_wsrep_support() {
if (have_wsrep())
{
mtr_report(" - binaries built with wsrep patch");
# Add galera test suites
mtr_report(" - adding wsrep, galera to default test suites");
push @DEFAULT_SUITES, qw(wsrep galera);
# ADD scripts to $PATH to that wsrep_sst_* can be found
$ENV{'PATH'} = $ENV{'PATH'}.':'.$basedir.'/scripts';
# Check whether WSREP_PROVIDER environment variable is set.
if (defined $ENV{'WSREP_PROVIDER'}) {
if ((mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") &&
($ENV{'WSREP_PROVIDER'} ne "none")) {
mtr_error("WSREP_PROVIDER env set to an invalid path");
}
# 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.
my $file_wsrep_provider=
mtr_file_exists("/usr/lib/galera/libgalera_smm.so",
"/usr/lib64/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;
} else {
mtr_verbose("Could not find wsrep provider library, setting it to 'none'");
$ENV{'WSREP_PROVIDER'}= "none";
}
}
}
}
sub mysql_server_start($) {
my ($mysqld, $tinfo) = @_;
......@@ -4827,6 +4786,7 @@ sub extract_warning_lines ($$) {
# Perl code.
my @antipatterns =
(
@global_suppressions,
qr/error .*connecting to master/,
qr/Plugin 'ndbcluster' will be forced to shutdown/,
qr/InnoDB: Error: in ALTER TABLE `test`.`t[12]`/,
......@@ -4883,10 +4843,6 @@ sub extract_warning_lines ($$) {
qr|InnoDB: Setting thread \d+ nice to \d+ failed, current nice \d+, errno 13|, # setpriority() fails under valgrind
qr|Failed to setup SSL|,
qr|SSL error: Failed to set ciphers to use|,
# Galera-related warnings.
qr|WSREP:.*down context.*|,
qr|WSREP: Failed to send state UUID:.*|,
qr|WSREP: wsrep_sst_receive_address.*|,
);
my $matched_lines= [];
......
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld.1]
innodb_file_per_table
[mysqld]
binlog-format=row
innodb_file_format=Barracuda
performance_schema=OFF
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-cluster-address=gcomm://
wsrep-provider=@ENV.WSREP_PROVIDER
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
wsrep-sync-wait=7
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_node_incoming_address=127.0.0.1
[mysqld.2]
innodb_file_per_table
binlog-format=row
innodb_file_format=Barracuda
performance_schema=OFF
wsrep_provider=@ENV.WSREP_PROVIDER
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_node_incoming_address=127.0.0.1
[ENV]
NODE_MYPORT_1= @mysqld.1.port
......
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" unless defined $::mysqld_variables{'wsrep-on'};
my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
"/usr/lib/galera/libgalera_smm.so",
"/usr/lib64/galera/libgalera_smm.so";
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 ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
return "No my_print_defaults" unless $epath;
push @::global_suppressions,
(
qr(WSREP:.*down context.*),
qr(WSREP: Failed to send state UUID:.*),
qr(WSREP: wsrep_sst_receive_address.*),
qr(WSREP: Could not open saved state file for reading: .*),
qr(WSREP: last inactive check more than .* skipping check),
qr(WSREP: Gap in state sequence. Need state transfer.),
qr(WSREP: Failed to prepare for incremental state transfer: .*),
);
$ENV{PATH}="$epath:$ENV{PATH}";
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
bless { };
......@@ -2,7 +2,8 @@
!include include/default_mysqld.cnf
[mysqld.1]
[ENV]
GALERA_BASE_PORT=@mysqld.1.#galera_port
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
# MDEV#5534: mysql_tzinfo_to_sql generates wrong query
#
......@@ -194,10 +195,9 @@ SET GLOBAL wsrep_slave_threads= 10;
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= '';
SET GLOBAL wsrep_provider_options= '';
SHOW STATUS LIKE 'wsrep_thread_count';
Variable_name Value
wsrep_thread_count 11
#
# MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
#
......@@ -215,4 +215,8 @@ SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= '';
SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
# End of test.
package My::Suite::WSREP;
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" unless defined $::mysqld_variables{'wsrep-on'};
my ($provider) = grep { -f $_ } $ENV{WSREP_PROVIDER},
"/usr/lib/galera/libgalera_smm.so",
"/usr/lib64/galera/libgalera_smm.so";
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 ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir;
return "No my_print_defaults" unless $epath;
$ENV{PATH}="$epath:$ENV{PATH}";
$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
bless { };
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT' --wsrep-on=1 --log-bin
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT'
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm://
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT' --wsrep-on=1 --wsrep_causal_reads=ON
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --wsrep_causal_reads=ON
--binlog-format=row --innodb_autoinc_lock_mode=2 --innodb_locks_unsafe_for_binlog=1 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT' --thread_handling=pool-of-threads
--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads
--source include/have_wsrep.inc
# Set galera's base_port so that test can run in parallel with other galera
# tests.
--disable_query_log
eval SET GLOBAL wsrep_provider_options='base_port=$GALERA_BASE_PORT';
--enable_query_log
SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
--echo
--echo # MDEV#5534: mysql_tzinfo_to_sql generates wrong query
--echo #
--echo # Testing wsrep_replicate_myisam variable.
--disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--enable_query_log
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_replicate_myisam;
SELECT @@global.wsrep_replicate_myisam;
......@@ -119,14 +111,9 @@ SHOW STATUS LIKE 'wsrep_thread_count';
SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
SET GLOBAL wsrep_slave_threads= 10;
--echo # Wait for applier threads to get created.
sleep 5;
sleep 3;
SHOW STATUS LIKE 'threads_connected';
# reset (for mtr internal checks)
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= '';
SET GLOBAL wsrep_provider_options= '';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo #
--echo # MDEV#6411: Setting set @@global.wsrep_sst_auth=NULL causes crash
......@@ -140,5 +127,11 @@ SET @@global.wsrep_sst_auth= NULL;
SELECT @@global.wsrep_sst_auth;
SET @@global.wsrep_sst_auth= @wsrep_sst_auth_saved;
# Reset (for mtr internal checks)
SET GLOBAL wsrep_slave_threads= @wsrep_slave_threads_saved;
SET GLOBAL wsrep_provider= none;
SET GLOBAL wsrep_cluster_address= '';
SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
--echo # End of test.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment