Commit 48a1a536 authored by unknown's avatar unknown

Merge neptunus.(none):/home/msvensson/mysql/same_tools/my50-same_tools

into  neptunus.(none):/home/msvensson/mysql/same_tools/my51-same_tools


mysql-test/mysql-test-run.pl:
  SCCS merged
parents 8a27de83 a574de91
......@@ -209,6 +209,7 @@ our $opt_fast;
our $opt_force;
our $opt_reorder= 0;
our $opt_enable_disabled;
our $opt_mem;
our $opt_gcov;
our $opt_gcov_err;
......@@ -643,6 +644,7 @@ sub command_line_setup () {
'tmpdir=s' => \$opt_tmpdir,
'vardir=s' => \$opt_vardir,
'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem,
# Misc
'comment=s' => \$opt_comment,
......@@ -715,6 +717,32 @@ sub command_line_setup () {
}
mtr_report("Using binlog format '$used_binlog_format'");
# --------------------------------------------------------------------------
# Check if we should speed up tests by trying to run on tmpfs
# --------------------------------------------------------------------------
if ( $opt_mem )
{
mtr_error("Can't use --mem and --vardir at the same time ")
if $opt_vardir;
mtr_error("Can't use --mem and --tmpdir at the same time ")
if $opt_tmpdir;
# Use /dev/shm as the preferred location for vardir and
# thus implicitly also tmpdir. Add other locations to list
my @tmpfs_locations= ("/dev/shm");
# One could maybe use "mount" to find tmpfs location(s)
foreach my $fs (@tmpfs_locations)
{
if ( -d $fs )
{
mtr_report("Using tmpfs in $fs");
$opt_mem= "$fs/var";
$opt_mem .= $ENV{'MTR_BUILD_THREAD'} if $ENV{'MTR_BUILD_THREAD'};
last;
}
}
}
# --------------------------------------------------------------------------
# Set the "var/" directory, as it is the base for everything else
# --------------------------------------------------------------------------
......@@ -1189,10 +1217,20 @@ sub check_mysqld_features () {
}
else
{
# The variable list is ended with a blank line, so when a line
# doesn't match the above regex, break the loop
# The variable list is ended with a blank line
if ( $line =~ /^[\s]*$/ )
{
last;
}
else
{
# Send out a warning, we should fix the variables that has no
# space between variable name and it's value
# or should it be fixed width column parsing? It does not
# look like that in function my_print_variables in my_getopt.c
mtr_warning("Could not parse variable list line : $line");
}
}
}
}
}
......@@ -1761,6 +1799,8 @@ sub kill_running_server () {
sub cleanup_stale_files () {
my $created_by_mem_file= "$glob_mysql_test_dir/var/created_by_mem";
mtr_report("Removing Stale Files");
if ( $opt_vardir eq "$glob_mysql_test_dir/var" )
......@@ -1768,7 +1808,17 @@ sub cleanup_stale_files () {
#
# Running with "var" in mysql-test dir
#
if ( -l "$glob_mysql_test_dir/var" )
if ( -l $opt_vardir)
{
# var is a symlink
if (-f $created_by_mem_file)
{
# Remove the directory which the link points at
rmtree(readlink($opt_vardir));
# Remove the entire "var" dir
rmtree("$opt_vardir/");
}
else
{
# Some users creates a soft link in mysql-test/var to another area
# - allow it
......@@ -1778,6 +1828,7 @@ sub cleanup_stale_files () {
rmtree("$opt_vardir/run");
rmtree("$opt_vardir/tmp");
}
}
else
{
# Remove the entire "var" dir
......@@ -1798,6 +1849,17 @@ sub cleanup_stale_files () {
rmtree("$opt_vardir/");
}
if ( $opt_mem )
{
# Runinng with var as a link to some "memory" location, normally tmpfs
rmtree($opt_mem);
mkpath($opt_mem);
mtr_verbose("Creating symlink from $opt_vardir to $opt_mem");
symlink($opt_mem, $opt_vardir);
# Put a small file to recognize this dir was created by --mem
mtr_tofile($created_by_mem_file, $opt_mem);
}
mkpath("$opt_vardir/log");
mkpath("$opt_vardir/run");
mkpath("$opt_vardir/tmp");
......@@ -1959,9 +2021,9 @@ sub ndbcluster_start_install ($) {
if (!$opt_bench)
{
# Use a smaller configuration
if ( $mysql_version_id < 50000 )
if ( $mysql_version_id < 50100 )
{
# 4.1 is using a "larger" --small configuration
# 4.1 and 5.0 is using a "larger" --small configuration
$ndb_no_ord=128;
$ndb_con_op=10000;
$ndb_dmem="40M";
......@@ -4316,6 +4378,9 @@ Options to control directories to use
vardir=DIR The directory where files generated from the test run
is stored (default: ./var). Specifying a ramdisk or
tmpfs will speed up tests.
mem=DIR Run testsuite in "memory" using tmpfs if
available(default: /dev/shm)
Options to control what test suites or cases to run
......
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