summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2008-01-08 10:50:07 +0100
committerunknown <msvensson@pilot.mysql.com>2008-01-08 10:50:07 +0100
commit2b58c0073fc0435ddf5b8b7e5ef1be057c39e77a (patch)
tree3b3f925362353319331b80ad14d280ef2a6e980c
parent022e8818181f582774705bc8c5580f8edb6f2cd8 (diff)
downloadmariadb-git-2b58c0073fc0435ddf5b8b7e5ef1be057c39e77a.tar.gz
Use a tempdir name for the directory that var symlink points at, otherwise it can conflict
with another MTR_BUILD_THREAD=auto run
-rwxr-xr-xmysql-test/mysql-test-run.pl17
1 files changed, 4 insertions, 13 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 4eda93fb664..a4cf7b41310 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -539,7 +539,7 @@ sub command_line_setup {
if $opt_tmpdir;
# Search through list of locations that are known
- # to be "fast disks" to list to find a suitable location
+ # to be "fast disks" to find a suitable location
# Use --mem=<dir> as first location to look.
my @tmpfs_locations= ($opt_mem, "/dev/shm", "/tmp");
@@ -547,8 +547,8 @@ sub command_line_setup {
{
if ( -d $fs )
{
- $opt_mem= "$fs/var";
- $opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
+ my $template= "var_${opt_mtr_build_thread}_XXXX";
+ $opt_mem= tempdir( $template, DIR => $fs, CLEANUP => 0);
last;
}
}
@@ -772,7 +772,6 @@ sub set_mtr_build_thread_ports($) {
mtr_require_unique_id_and_wait("/tmp/mysql-test-ports", 200, 299);
print "got ".$mtr_build_thread."\n";
}
- $opt_mtr_build_thread= $mtr_build_thread;
$ENV{MTR_BUILD_THREAD}= $mtr_build_thread;
# Calculate baseport
@@ -1272,7 +1271,7 @@ sub remove_stale_vardir () {
{
# var is a symlink
- if ( $opt_mem and readlink($opt_vardir) eq $opt_mem )
+ if ( $opt_mem )
{
# Remove the directory which the link points at
mtr_verbose("Removing " . readlink($opt_vardir));
@@ -1282,14 +1281,6 @@ sub remove_stale_vardir () {
mtr_verbose("unlink($opt_vardir)");
unlink($opt_vardir);
}
- elsif ( $opt_mem )
- {
- # Just remove the "var" symlink
- mtr_report(" - WARNING: Removing '$opt_vardir' symlink it's wrong");
-
- mtr_verbose("unlink($opt_vardir)");
- unlink($opt_vardir);
- }
else
{
# Some users creates a soft link in mysql-test/var to another area