Commit 9605bc63 authored by Bjorn Munch's avatar Bjorn Munch

Bug #56125 MTR2 start-and-exit removes server tmpdir, server becomes not operational

This happens when creating new tmpdir due to too long socket path
Don't delete it if --start-and-exit, but warn user to do it.
parent 7b216d76
...@@ -110,12 +110,24 @@ my $path_vardir_trace; # unix formatted opt_vardir for trace files ...@@ -110,12 +110,24 @@ my $path_vardir_trace; # unix formatted opt_vardir for trace files
my $opt_tmpdir; # Path to use for tmp/ dir my $opt_tmpdir; # Path to use for tmp/ dir
my $opt_tmpdir_pid; my $opt_tmpdir_pid;
my $opt_start;
my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
END { END {
if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ ) if ( defined $opt_tmpdir_pid and $opt_tmpdir_pid == $$ )
{ {
# Remove the tempdir this process has created if (!$opt_start_exit)
mtr_verbose("Removing tmpdir '$opt_tmpdir"); {
rmtree($opt_tmpdir); # Remove the tempdir this process has created
mtr_verbose("Removing tmpdir $opt_tmpdir");
rmtree($opt_tmpdir);
}
else
{
mtr_warning("tmpdir $opt_tmpdir should be removed after the server has finished");
}
} }
} }
...@@ -215,10 +227,6 @@ my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds ...@@ -215,10 +227,6 @@ my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
sub suite_timeout { return $opt_suite_timeout * 60; }; sub suite_timeout { return $opt_suite_timeout * 60; };
sub check_timeout { return $opt_testcase_timeout * 6; }; sub check_timeout { return $opt_testcase_timeout * 6; };
my $opt_start;
my $opt_start_dirty;
my $opt_start_exit;
my $start_only;
my $opt_wait_all; my $opt_wait_all;
my $opt_user_args; my $opt_user_args;
my $opt_repeat= 1; my $opt_repeat= 1;
......
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