diff options
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 77 |
1 files changed, 59 insertions, 18 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e0bbeec7a87..28fe740b539 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -76,6 +76,7 @@ $Devel::Trace::TRACE= 0; # Don't trace boring init stuff #require 5.6.1; use File::Path; use File::Basename; +use File::Copy; use Cwd; use Getopt::Long; use Sys::Hostname; @@ -156,7 +157,6 @@ our $path_client_bindir; our $path_language; our $path_timefile; our $path_manager_log; # Used by mysqldadmin -our $path_mysqltest_log; our $path_slave_load_tmpdir; # What is this?! our $path_my_basedir; our $opt_vardir; # A path but set directly on cmd line @@ -482,9 +482,6 @@ sub initial_setup () { $glob_basedir= dirname($glob_mysql_test_dir); $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable - # needs to be same length to test logging (FIXME what???) - $path_slave_load_tmpdir= "../../var/tmp"; - $path_my_basedir= $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir; @@ -1114,6 +1111,7 @@ sub environment_setup () { $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; $ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir; + $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir; $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; @@ -1217,10 +1215,40 @@ sub kill_and_cleanup () { mtr_report("Removing Stale Files"); - rmtree("$opt_vardir/log"); - rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port"); - rmtree("$opt_vardir/run"); - rmtree("$opt_vardir/tmp"); + if ( $opt_vardir eq "$glob_mysql_test_dir/var" ) + { + # + # Running with "var" in mysql-test dir + # + if ( -l "$glob_mysql_test_dir/var" ) + { + # Some users creates a soft link in mysql-test/var to another area + # - allow it + mtr_report("WARNING: Using the 'mysql-test/var' symlink"); + rmtree("$opt_vardir/log"); + rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port"); + rmtree("$opt_vardir/run"); + rmtree("$opt_vardir/tmp"); + } + else + { + # Remove the entire "var" dir + rmtree("$opt_vardir/"); + } + } + else + { + # + # Running with "var" in some other place + # + + # Remove the var/ dir in mysql-test dir if any + # this could be an old symlink that shouldn't be there + rmtree("$glob_mysql_test_dir/var"); + + # Remove the "var" dir + rmtree("$opt_vardir/"); + } mkpath("$opt_vardir/log"); mkpath("$opt_vardir/run"); @@ -1236,7 +1264,7 @@ sub kill_and_cleanup () { $slave->[0]->{'path_myddir'}, $slave->[1]->{'path_myddir'}, $slave->[2]->{'path_myddir'}); - + foreach my $instance (@{$instance_manager->{'instances'}}) { push(@data_dir_lst, $instance->{'path_datadir'}); @@ -1249,18 +1277,27 @@ sub kill_and_cleanup () { mkpath("$data_dir/test"); } - # To make some old test cases work, we create a soft - # link from the old "var" location to the new one - - if ( ! $glob_win32 and $opt_vardir ne "$glob_mysql_test_dir/var" ) + # Make a link std_data_ln in var/ that points to std_data + if ( ! $glob_win32 ) { - # FIXME why bother with the above, why not always remove all of var?! - rmtree("$glob_mysql_test_dir/var"); # Clean old var, FIXME or rename it?! - symlink($opt_vardir, "$glob_mysql_test_dir/var"); + symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln"); + } + else + { + # on windows, copy all files from std_data into var/std_data_ln + mkpath("$opt_vardir/std_data_ln"); + opendir(DIR, "$glob_mysql_test_dir/std_data") + or mtr_error("Can't find the std_data directory: $!"); + for(readdir(DIR)) { + next if -d "$glob_mysql_test_dir/std_data/$_"; + copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_"); + } + closedir(DIR); } } + sub check_ssl_support () { if ($opt_skip_ssl) @@ -2345,8 +2382,12 @@ sub mysqld_arguments ($$$$$$) { mtr_add_arg($args, "%s--skip-innodb", $prefix); mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); mtr_add_arg($args, "%s--skip-slave-start", $prefix); + + # Directory where slaves find the dumps generated by "load data" + # on the server. The path need to have constant length otherwise + # test results will vary, thus a relative path is used. mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, - $path_slave_load_tmpdir); + "../tmp"); mtr_add_arg($args, "%s--socket=%s", $prefix, $slave->[$idx]->{'path_mysock'}); mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); @@ -3025,7 +3066,7 @@ Options to control what engine/variation to run sp-protocol Create a stored procedure to execute all queries compress Use the compressed protocol between client and server ssl Use ssl protocol between client and server - skip-ssl Dont start sterver with support for ssl connections + skip-ssl Dont start server with support for ssl connections bench Run the benchmark suite FIXME small-bench FIXME |