Commit 60f1320e authored by unknown's avatar unknown

Move initializations of environment variables that are constant during the...

Move initializations of environment variables that are constant during the whole testrun to 'environment_setup'
Split out functions that detects if we need master or slave restarts


mysql-test/lib/mtr_process.pl:
  Fix spelling error
mysql-test/mysql-test-run.pl:
  Move initializations of environment variables that are constant during the whole testrun to 'environment_setup'
  Split out functions 'run_testcase_need_master_restart' and 'run_testcase_need_slave_restart'
parent 551f9ded
...@@ -633,7 +633,7 @@ sub mtr_check_stop_servers ($) { ...@@ -633,7 +633,7 @@ sub mtr_check_stop_servers ($) {
} }
else else
{ {
mtr_verbose("All ports where free, continuing"); mtr_verbose("All ports were free, continuing");
} }
} }
} }
...@@ -896,6 +896,7 @@ sub check_expected_crash_and_restart($) ...@@ -896,6 +896,7 @@ sub check_expected_crash_and_restart($)
sub mtr_record_dead_children () { sub mtr_record_dead_children () {
my $process_died= 0;
my $ret_pid; my $ret_pid;
# Wait without blockinng to see if any processes had died # Wait without blockinng to see if any processes had died
...@@ -904,7 +905,9 @@ sub mtr_record_dead_children () { ...@@ -904,7 +905,9 @@ sub mtr_record_dead_children () {
{ {
mtr_warning("mtr_record_dead_children: $ret_pid"); mtr_warning("mtr_record_dead_children: $ret_pid");
mark_process_dead($ret_pid); mark_process_dead($ret_pid);
$process_died= 1;
} }
return $process_died;
} }
sub start_reap_all { sub start_reap_all {
......
...@@ -357,7 +357,7 @@ sub initialize_servers (); ...@@ -357,7 +357,7 @@ sub initialize_servers ();
sub mysql_install_db (); sub mysql_install_db ();
sub install_db ($$); sub install_db ($$);
sub run_testcase ($); sub run_testcase ($);
sub run_testcase_stop_servers ($); sub run_testcase_stop_servers ($$$);
sub run_testcase_start_servers ($); sub run_testcase_start_servers ($);
sub report_failure_and_restart ($); sub report_failure_and_restart ($);
sub do_before_start_master ($$); sub do_before_start_master ($$);
...@@ -1296,9 +1296,19 @@ sub executable_setup () { ...@@ -1296,9 +1296,19 @@ sub executable_setup () {
} }
sub generate_cmdline_mysqldump ($) {
my($mysqld) = @_;
return
"$exe_mysqldump --no-defaults -uroot " .
"--port=$mysqld->{'port'} " .
"--socket=$mysqld->{'path_sock'} --password=";
}
############################################################################## ##############################################################################
# #
# Set environment to be used by childs of this process # Set environment to be used by childs of this process for
# things that are constant duting the whole lifetime of mysql-test-run.pl
# #
############################################################################## ##############################################################################
...@@ -1323,18 +1333,11 @@ sub environment_setup () { ...@@ -1323,18 +1333,11 @@ sub environment_setup () {
($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : "");
} }
# --------------------------------------------------------------------------
# Add the path where mysqld will find udf_example.so
# --------------------------------------------------------------------------
$ENV{'LD_LIBRARY_PATH'}=
($lib_udf_example ? dirname($lib_udf_example) : "") .
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Also command lines in .opt files may contain env vars # Also command lines in .opt files may contain env vars
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'UMASK'}= "0660"; # The octal *string* $ENV{'UMASK'}= "0660"; # The octal *string*
$ENV{'UMASK_DIR'}= "0770"; # The octal *string* $ENV{'UMASK_DIR'}= "0770"; # The octal *string*
$ENV{'LC_COLLATE'}= "C"; $ENV{'LC_COLLATE'}= "C";
...@@ -1352,10 +1355,30 @@ sub environment_setup () { ...@@ -1352,10 +1355,30 @@ sub environment_setup () {
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME # $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV{'MYSQL_TCP_PORT'}= 3306; $ENV{'MYSQL_TCP_PORT'}= 3306;
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
# ----------------------------------------------------
# Setup env for NDB
# ----------------------------------------------------
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
$ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port; $ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
$ENV{'NDBCLUSTER_PORT_SLAVE'}=$opt_ndbcluster_port_slave; $ENV{'NDBCLUSTER_PORT_SLAVE'}= $opt_ndbcluster_port_slave;
$ENV{'NDB_STATUS_OK'}= "YES";
$ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'};
$ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[0]->{'installed_ok'};;
$ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
$ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
$ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log;
$ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
# ----------------------------------------------------
# Setup env for IM
# ----------------------------------------------------
$ENV{'IM_EXE'}= $exe_im; $ENV{'IM_EXE'}= $exe_im;
$ENV{'IM_PATH_PID'}= $instance_manager->{path_pid}; $ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
$ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid}; $ENV{'IM_PATH_ANGEL_PID'}= $instance_manager->{path_angel_pid};
...@@ -1370,9 +1393,168 @@ sub environment_setup () { ...@@ -1370,9 +1393,168 @@ sub environment_setup () {
$ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port};
$ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid};
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set # ----------------------------------------------------
# Setup env so childs can execute mysqlcheck
# ----------------------------------------------------
my $cmdline_mysqlcheck=
"$exe_mysqlcheck --no-defaults -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlcheck .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace";
}
$ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
# ----------------------------------------------------
# Setup env to childs can execute myqldump
# ----------------------------------------------------
my $cmdline_mysqldump= generate_cmdline_mysqldump($master->[0]);
my $cmdline_mysqldumpslave= generate_cmdline_mysqldump($slave->[0]);
if ( $opt_debug )
{
$cmdline_mysqldump .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace";
$cmdline_mysqldumpslave .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace";
}
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
$ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
# ----------------------------------------------------
# Setup env so childs can execute mysqlslap
# ----------------------------------------------------
unless ( $glob_win32 )
{
my $cmdline_mysqlslap=
"$exe_mysqlslap -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password= " .
"--lock-directory=$opt_tmpdir";
if ( $opt_debug )
{
$cmdline_mysqlslap .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace";
}
$ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
}
# ----------------------------------------------------
# Setup env so childs can execute mysqlimport
# ----------------------------------------------------
my $cmdline_mysqlimport=
"$exe_mysqlimport -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlimport .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace";
}
$ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
# ----------------------------------------------------
# Setup env so childs can execute mysqlshow
# ----------------------------------------------------
my $cmdline_mysqlshow=
"$exe_mysqlshow -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlshow .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace";
}
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
# ----------------------------------------------------
# Setup env so childs can execute mysqlbinlog
# ----------------------------------------------------
my $cmdline_mysqlbinlog=
"$exe_mysqlbinlog" .
" --no-defaults --local-load=$opt_tmpdir" .
" --character-sets-dir=$path_charsetsdir";
if ( $opt_debug )
{
$cmdline_mysqlbinlog .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace";
}
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
# ----------------------------------------------------
# Setup env so childs can execute mysql
# ----------------------------------------------------
my $cmdline_mysql=
"$exe_mysql --no-defaults --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
$ENV{'MYSQL'}= $cmdline_mysql;
# ----------------------------------------------------
# Setup env so childs can execute mysql_client_test
# ----------------------------------------------------
my $cmdline_mysql_client_test=
"$exe_mysql_client_test --no-defaults --testcase --user=root --silent " .
"--port=$master->[0]->{'port'} " .
"--vardir=$opt_vardir " .
"--socket=$master->[0]->{'path_sock'}";
if ( $opt_debug )
{
$cmdline_mysql_client_test .=
" --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace";
}
if ( $glob_use_embedded_server )
{
$cmdline_mysql_client_test.=
" -A --language=$path_language" .
" -A --datadir=$slave->[0]->{'path_myddir'}" .
" -A --character-sets-dir=$path_charsetsdir";
}
$ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
# ----------------------------------------------------
# Setup env so childs can execute mysql_fix_system_tables
# ----------------------------------------------------
my $cmdline_mysql_fix_system_tables=
"$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " .
"--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
# ----------------------------------------------------
# Setup env so childs can execute my_print_defaults
# ----------------------------------------------------
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
# ----------------------------------------------------
# Add the path where mysqld will find udf_example.so
# ----------------------------------------------------
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
$ENV{'LD_LIBRARY_PATH'}=
($lib_udf_example ? dirname($lib_udf_example) : "") .
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
# ----------------------------------------------------
# We are nice and report a bit about our settings # We are nice and report a bit about our settings
# ----------------------------------------------------
if (!$opt_extern) if (!$opt_extern)
{ {
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n"; print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
...@@ -2284,15 +2466,19 @@ sub run_testcase ($) { ...@@ -2284,15 +2466,19 @@ sub run_testcase ($) {
return; return;
} }
run_testcase_stop_servers($tinfo); my $master_restart= run_testcase_need_master_restart($tinfo);
my $slave_restart= run_testcase_need_slave_restart($tinfo);
if ($master_restart or $slave_restart)
{
run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Prepare to start masters. Even if we use embedded, we want to run # Prepare to start masters. Even if we use embedded, we want to run
# the preparation. # the preparation.
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
$ENV{'TZ'}= $tinfo->{'timezone'};
mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
if ( $master->[1]->{'pid'} ) if ( $master->[1]->{'pid'} )
{ {
...@@ -2303,12 +2489,15 @@ sub run_testcase ($) { ...@@ -2303,12 +2489,15 @@ sub run_testcase ($) {
# If any mysqld servers running died, we have to know # If any mysqld servers running died, we have to know
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
mtr_record_dead_children(); my $died= mtr_record_dead_children();
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Start masters needed by the testcase # Start masters needed by the testcase
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
if ($died or $master_restart or $slave_restart)
{
run_testcase_start_servers($tinfo); run_testcase_start_servers($tinfo);
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# If --start-and-exit or --start-dirty given, stop here to let user manually # If --start-and-exit or --start-dirty given, stop here to let user manually
...@@ -2325,8 +2514,6 @@ sub run_testcase ($) { ...@@ -2325,8 +2514,6 @@ sub run_testcase ($) {
# Run the test case # Run the test case
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
mtr_report_test_name($tinfo);
{ {
# remove the old reject file # remove the old reject file
if ( $opt_suite eq "main" ) if ( $opt_suite eq "main" )
...@@ -2340,6 +2527,7 @@ sub run_testcase ($) { ...@@ -2340,6 +2527,7 @@ sub run_testcase ($) {
unlink($path_timefile); unlink($path_timefile);
my $res= run_mysqltest($tinfo); my $res= run_mysqltest($tinfo);
mtr_report_test_name($tinfo);
if ( $res == 0 ) if ( $res == 0 )
{ {
mtr_report_test_passed($tinfo); mtr_report_test_passed($tinfo);
...@@ -2993,24 +3181,9 @@ sub stop_all_servers () { ...@@ -2993,24 +3181,9 @@ sub stop_all_servers () {
} }
# ---------------------------------------------------------------------- sub run_testcase_need_master_restart($)
# If not using a running servers we may need to stop and restart. {
# We restart in the case we have initiation scripts, server options my ($tinfo)= @_;
# etc to run. But we also restart again after the test first restart
# and test is run, to get back to normal server settings.
#
# To make the code a bit more clean, we actually only stop servers
# here, and mark this to be done. Then a generic "start" part will
# start up the needed servers again.
# ----------------------------------------------------------------------
sub run_testcase_stop_servers($) {
my $tinfo= shift;
if ( $glob_use_running_server || $glob_use_embedded_server )
{
return;
}
# We try to find out if we are to restart the master(s) # We try to find out if we are to restart the master(s)
my $do_restart= 0; # Assumes we don't have to my $do_restart= 0; # Assumes we don't have to
...@@ -3067,6 +3240,91 @@ sub run_testcase_stop_servers($) { ...@@ -3067,6 +3240,91 @@ sub run_testcase_stop_servers($) {
join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); join(" ", @{$master->[0]->{'start_opts'}}) . "'" );
} }
return $do_restart;
}
sub run_testcase_need_slave_restart($)
{
my ($tinfo)= @_;
# We try to find out if we are to restart the slaves
my $do_slave_restart= 0; # Assumes we don't have to
# FIXME only restart slave when necessary
$do_slave_restart= 1;
# if ( ! $slave->[0]->{'pid'} )
# {
# # mtr_verbose("Slave not started, no need to check slave restart");
# }
# elsif ( $do_restart )
# {
# $do_slave_restart= 1; # Always restart if master restart
# mtr_verbose("Restart slave because: Master restart");
# }
# elsif ( $tinfo->{'slave_sh'} )
# {
# $do_slave_restart= 1; # Always restart if script to run
# mtr_verbose("Restart slave because: Always restart if script to run");
# }
# elsif ( ! $opt_skip_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 0 and
# $clusters->[1]->{'pid'} != 0 )
# {
# $do_slave_restart= 1; # Restart without slave cluster
# mtr_verbose("Restart slave because: Test does not need slave cluster");
# }
# elsif ( ! $opt_with_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 1 and
# $clusters->[1]->{'pid'} == 0 )
# {
# $do_slave_restart= 1; # Restart with slave cluster
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
return $do_slave_restart;
}
# ----------------------------------------------------------------------
# If not using a running servers we may need to stop and restart.
# We restart in the case we have initiation scripts, server options
# etc to run. But we also restart again after the test first restart
# and test is run, to get back to normal server settings.
#
# To make the code a bit more clean, we actually only stop servers
# here, and mark this to be done. Then a generic "start" part will
# start up the needed servers again.
# ----------------------------------------------------------------------
sub run_testcase_stop_servers($$$) {
my ($tinfo, $do_restart, $do_slave_restart)= @_;
if ( $glob_use_running_server || $glob_use_embedded_server )
{
return;
}
my $pid; my $pid;
my %admin_pids; # hash of admin processes that requests shutdown my %admin_pids; # hash of admin processes that requests shutdown
my @kill_pids; # list of processes to shutdown/kill my @kill_pids; # list of processes to shutdown/kill
...@@ -3124,62 +3382,7 @@ sub run_testcase_stop_servers($) { ...@@ -3124,62 +3382,7 @@ sub run_testcase_stop_servers($) {
} }
} }
# We try to find out if we are to restart the slaves if ( $do_restart || $do_slave_restart )
my $do_slave_restart= 0; # Assumes we don't have to
# FIXME only restaret when necessary
$do_slave_restart= 1;
# if ( ! $slave->[0]->{'pid'} )
# {
# # mtr_verbose("Slave not started, no need to check slave restart");
# }
# elsif ( $do_restart )
# {
# $do_slave_restart= 1; # Always restart if master restart
# mtr_verbose("Restart slave because: Master restart");
# }
# elsif ( $tinfo->{'slave_sh'} )
# {
# $do_slave_restart= 1; # Always restart if script to run
# mtr_verbose("Restart slave because: Always restart if script to run");
# }
# elsif ( ! $opt_skip_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 0 and
# $clusters->[1]->{'pid'} != 0 )
# {
# $do_slave_restart= 1; # Restart without slave cluster
# mtr_verbose("Restart slave because: Test does not need slave cluster");
# }
# elsif ( ! $opt_with_ndbcluster_slave and
# $tinfo->{'ndb_test'} == 1 and
# $clusters->[1]->{'pid'} == 0 )
# {
# $do_slave_restart= 1; # Restart with slave cluster
# mtr_verbose("Restart slave because: Test need slave cluster");
# }
# elsif ( $tinfo->{'slave_restart'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: slave_restart");
# }
# elsif ( $slave->[0]->{'running_slave_is_special'} )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running_slave_is_special");
# }
# # Check that running slave was started with same options
# # as the current test requires
# elsif (! mtr_same_opts($slave->[0]->{'start_opts'},
# $tinfo->{'slave_opt'}) )
# {
# $do_slave_restart= 1;
# mtr_verbose("Restart slave because: running with different options '" .
# join(" ", @{$tinfo->{'slave_opt'}}) . "' != '" .
# join(" ", @{$slave->[0]->{'start_opts'}}) . "'" );
# }
if ( $do_slave_restart )
{ {
delete $slave->[0]->{'running_slave_is_special'}; # Forget history delete $slave->[0]->{'running_slave_is_special'}; # Forget history
...@@ -3627,135 +3830,9 @@ sub run_check_testcase ($$) { ...@@ -3627,135 +3830,9 @@ sub run_check_testcase ($$) {
} }
sub generate_cmdline_mysqldump ($) {
my($info) = @_;
return
"$exe_mysqldump --no-defaults -uroot " .
"--port=$info->[0]->{'port'} " .
"--socket=$info->[0]->{'path_sock'} --password=";
}
sub run_mysqltest ($) { sub run_mysqltest ($) {
my $tinfo= shift; my ($tinfo)= @_;
my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlcheck .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlcheck.trace";
}
my $cmdline_mysqldump= generate_cmdline_mysqldump $master;
my $cmdline_mysqldumpslave= generate_cmdline_mysqldump $slave;
if ( $opt_debug )
{
$cmdline_mysqldump .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqldump-master.trace";
$cmdline_mysqldumpslave .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqldump-slave.trace";
}
my $cmdline_mysqlslap;
unless ( $glob_win32 )
{
$cmdline_mysqlslap= "$exe_mysqlslap -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password= " .
"--lock-directory=$opt_tmpdir";
if ( $opt_debug )
{
$cmdline_mysqlslap .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlslap.trace";
}
}
my $cmdline_mysqlimport= "$exe_mysqlimport -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlimport .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace";
}
my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'} --password=";
if ( $opt_debug )
{
$cmdline_mysqlshow .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace";
}
my $cmdline_mysqlbinlog=
"$exe_mysqlbinlog" .
" --no-defaults --local-load=$opt_tmpdir" .
" --character-sets-dir=$path_charsetsdir";
if ( $opt_debug )
{
$cmdline_mysqlbinlog .=
" --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace";
}
my $cmdline_mysql=
"$exe_mysql --no-defaults --host=localhost --user=root --password= " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
my $cmdline_mysql_client_test=
"$exe_mysql_client_test --no-defaults --testcase --user=root --silent " .
"--port=$master->[0]->{'port'} " .
"--vardir=$opt_vardir " .
"--socket=$master->[0]->{'path_sock'}";
if ( $opt_debug )
{
$cmdline_mysql_client_test .=
" --debug=d:t:A,$opt_vardir_trace/log/mysql_client_test.trace";
}
if ( $glob_use_embedded_server )
{
$cmdline_mysql_client_test.=
" -A --language=$path_language" .
" -A --datadir=$slave->[0]->{'path_myddir'}" .
" -A --character-sets-dir=$path_charsetsdir";
}
my $cmdline_mysql_fix_system_tables=
"$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " .
"--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " .
"--port=$master->[0]->{'port'} " .
"--socket=$master->[0]->{'path_sock'}";
$ENV{'MYSQL'}= $cmdline_mysql;
$ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
$ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap unless $glob_win32;
$ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
$ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
$ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
$ENV{'NDB_STATUS_OK'}= $clusters->[0]->{'installed_ok'};
$ENV{'NDB_SLAVE_STATUS_OK'}= $clusters->[0]->{'installed_ok'};;
$ENV{'NDB_EXTRA_TEST'}= $opt_ndb_extra_test;
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
$ENV{'NDB_BACKUP_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_DATA_DIR'}= $clusters->[0]->{'data_dir'};
$ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir;
$ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log;
$ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring;
my $exe= $exe_mysqltest; my $exe= $exe_mysqltest;
my $args; my $args;
...@@ -3834,7 +3911,8 @@ sub run_mysqltest ($) { ...@@ -3834,7 +3911,8 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace); mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
$opt_vardir_trace);
} }
if ( $opt_ssl_supported ) if ( $opt_ssl_supported )
...@@ -3847,9 +3925,9 @@ sub run_mysqltest ($) { ...@@ -3847,9 +3925,9 @@ sub run_mysqltest ($) {
$glob_mysql_test_dir); $glob_mysql_test_dir);
} }
# Turn on SSL for all test cases
if ( $opt_ssl ) if ( $opt_ssl )
{ {
# Turn on SSL for _all_ test cases if option --ssl was used
mtr_add_arg($args, "--ssl", mtr_add_arg($args, "--ssl",
$glob_mysql_test_dir); $glob_mysql_test_dir);
} }
...@@ -3931,6 +4009,11 @@ sub run_mysqltest ($) { ...@@ -3931,6 +4009,11 @@ sub run_mysqltest ($) {
} }
} }
# -------------------------------------------------------
# Init variables that change for each testcase
# -------------------------------------------------------
$ENV{'TZ'}= $tinfo->{'timezone'};
my $res = mtr_run_test($exe,$args,"","",$path_timefile,""); my $res = mtr_run_test($exe,$args,"","",$path_timefile,"");
if ( $opt_check_testcases ) if ( $opt_check_testcases )
......
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