mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
mtr_cases.pl:
Bug#11466: Script can now get test case name from test case file path on command line mysql-test-run.pl: Bug#11466: Added --skip-ndbcluster/--skip-ndb option mtr_cases.pl: Don't set --default-time-zone if opt file sets it Restart the server if time zone is given in opt file mysql-test-run.pl: Don't remove symlink to "var" directory in cleanup Removed duplicate/unessesary options to mysqld
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
# and is part of the translation of the Bourne shell script with the
|
# and is part of the translation of the Bourne shell script with the
|
||||||
# same name.
|
# same name.
|
||||||
|
|
||||||
|
use File::Basename;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
sub collect_test_cases ($);
|
sub collect_test_cases ($);
|
||||||
@ -39,6 +40,7 @@ sub collect_test_cases ($) {
|
|||||||
if ( @::opt_cases )
|
if ( @::opt_cases )
|
||||||
{
|
{
|
||||||
foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
|
foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
|
||||||
|
$tname= basename($tname, ".test");
|
||||||
my $elem= "$tname.test";
|
my $elem= "$tname.test";
|
||||||
if ( ! -f "$testdir/$elem")
|
if ( ! -f "$testdir/$elem")
|
||||||
{
|
{
|
||||||
@ -161,52 +163,73 @@ sub collect_one_test_case($$$$$) {
|
|||||||
my $slave_sh= "$testdir/$tname-slave.sh";
|
my $slave_sh= "$testdir/$tname-slave.sh";
|
||||||
my $disabled= "$testdir/$tname.disabled";
|
my $disabled= "$testdir/$tname.disabled";
|
||||||
|
|
||||||
$tinfo->{'master_opt'}= ["--default-time-zone=+3:00"];
|
$tinfo->{'master_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
|
||||||
$tinfo->{'slave_opt'}= ["--default-time-zone=+3:00"];
|
$tinfo->{'slave_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
|
||||||
$tinfo->{'slave_mi'}= [];
|
$tinfo->{'slave_mi'}= [];
|
||||||
|
|
||||||
if ( -f $master_opt_file )
|
if ( -f $master_opt_file )
|
||||||
{
|
{
|
||||||
$tinfo->{'master_restart'}= 1; # We think so for now
|
$tinfo->{'master_restart'}= 1; # We think so for now
|
||||||
# This is a dirty hack from old mysql-test-run, we use the opt file
|
|
||||||
# to flag other things as well, it is not a opt list at all
|
|
||||||
$tinfo->{'master_opt'}= mtr_get_opts_from_file($master_opt_file);
|
|
||||||
|
|
||||||
foreach my $opt (@{$tinfo->{'master_opt'}})
|
MASTER_OPT:
|
||||||
{
|
{
|
||||||
my $value;
|
my $master_opt= mtr_get_opts_from_file($master_opt_file);
|
||||||
|
|
||||||
$value= mtr_match_prefix($opt, "--timezone=");
|
foreach my $opt ( @$master_opt )
|
||||||
|
|
||||||
if ( defined $value )
|
|
||||||
{
|
{
|
||||||
$tinfo->{'timezone'}= $value;
|
my $value;
|
||||||
$tinfo->{'master_opt'}= [];
|
|
||||||
$tinfo->{'master_restart'}= 0;
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
|
|
||||||
$value= mtr_match_prefix($opt, "--result-file=");
|
# This is a dirty hack from old mysql-test-run, we use the opt
|
||||||
|
# file to flag other things as well, it is not a opt list at
|
||||||
|
# all
|
||||||
|
|
||||||
if ( defined $value )
|
$value= mtr_match_prefix($opt, "--timezone=");
|
||||||
{
|
if ( defined $value )
|
||||||
$tinfo->{'result_file'}= "r/$value.result";
|
|
||||||
if ( $::opt_result_ext and $::opt_record or
|
|
||||||
-f "$tinfo->{'result_file'}$::opt_result_ext")
|
|
||||||
{
|
{
|
||||||
$tinfo->{'result_file'}.= $::opt_result_ext;
|
$tinfo->{'timezone'}= $value;
|
||||||
|
$tinfo->{'skip'}= 1 if $::glob_win32; # FIXME server unsets TZ
|
||||||
|
last MASTER_OPT;
|
||||||
}
|
}
|
||||||
$tinfo->{'master_opt'}= [];
|
|
||||||
$tinfo->{'master_restart'}= 0;
|
$value= mtr_match_prefix($opt, "--result-file=");
|
||||||
last;
|
if ( defined $value )
|
||||||
|
{
|
||||||
|
$tinfo->{'result_file'}= "r/$value.result";
|
||||||
|
if ( $::opt_result_ext and $::opt_record or
|
||||||
|
-f "$tinfo->{'result_file'}$::opt_result_ext")
|
||||||
|
{
|
||||||
|
$tinfo->{'result_file'}.= $::opt_result_ext;
|
||||||
|
}
|
||||||
|
$tinfo->{'master_restart'}= 0;
|
||||||
|
last MASTER_OPT;
|
||||||
|
}
|
||||||
|
|
||||||
|
# If we set default time zone, remove the one we have
|
||||||
|
$value= mtr_match_prefix($opt, "--default-time-zone=");
|
||||||
|
if ( defined $value )
|
||||||
|
{
|
||||||
|
$tinfo->{'master_opt'}= [];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ok, this was a real option list, add it
|
||||||
|
push(@{$tinfo->{'master_opt'}}, @$master_opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( -f $slave_opt_file )
|
if ( -f $slave_opt_file )
|
||||||
{
|
{
|
||||||
$tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file);
|
|
||||||
$tinfo->{'slave_restart'}= 1;
|
$tinfo->{'slave_restart'}= 1;
|
||||||
|
my $slave_opt= mtr_get_opts_from_file($slave_opt_file);
|
||||||
|
|
||||||
|
foreach my $opt ( @$slave_opt )
|
||||||
|
{
|
||||||
|
# If we set default time zone, remove the one we have
|
||||||
|
my $value= mtr_match_prefix($opt, "--default-time-zone=");
|
||||||
|
$tinfo->{'slave_opt'}= [] if defined $value;
|
||||||
|
}
|
||||||
|
push(@{$tinfo->{'slave_opt'}}, @$slave_opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( -f $slave_mi_file )
|
if ( -f $slave_mi_file )
|
||||||
|
@ -264,6 +264,7 @@ our $opt_warnings;
|
|||||||
|
|
||||||
our $opt_udiff;
|
our $opt_udiff;
|
||||||
|
|
||||||
|
our $opt_skip_ndbcluster;
|
||||||
our $opt_with_ndbcluster;
|
our $opt_with_ndbcluster;
|
||||||
our $opt_with_openssl;
|
our $opt_with_openssl;
|
||||||
|
|
||||||
@ -463,6 +464,7 @@ sub command_line_setup () {
|
|||||||
# Control what test suites or cases to run
|
# Control what test suites or cases to run
|
||||||
'force' => \$opt_force,
|
'force' => \$opt_force,
|
||||||
'with-ndbcluster' => \$opt_with_ndbcluster,
|
'with-ndbcluster' => \$opt_with_ndbcluster,
|
||||||
|
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
|
||||||
'do-test=s' => \$opt_do_test,
|
'do-test=s' => \$opt_do_test,
|
||||||
'suite=s' => \$opt_suite,
|
'suite=s' => \$opt_suite,
|
||||||
'skip-rpl' => \$opt_skip_rpl,
|
'skip-rpl' => \$opt_skip_rpl,
|
||||||
@ -662,6 +664,11 @@ sub command_line_setup () {
|
|||||||
$opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
|
$opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $opt_skip_ndbcluster )
|
||||||
|
{
|
||||||
|
$opt_with_ndbcluster= 0;
|
||||||
|
}
|
||||||
|
|
||||||
# FIXME
|
# FIXME
|
||||||
|
|
||||||
#if ( $opt_valgrind or $opt_valgrind_all )
|
#if ( $opt_valgrind or $opt_valgrind_all )
|
||||||
@ -1020,11 +1027,6 @@ sub kill_and_cleanup () {
|
|||||||
|
|
||||||
mtr_report("Removing Stale Files");
|
mtr_report("Removing Stale Files");
|
||||||
|
|
||||||
if ( -l $opt_vardir and ! unlink($opt_vardir) )
|
|
||||||
{
|
|
||||||
mtr_error("Can't remove soft link \"$opt_vardir\"");
|
|
||||||
}
|
|
||||||
|
|
||||||
rmtree("$opt_vardir/log");
|
rmtree("$opt_vardir/log");
|
||||||
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port");
|
rmtree("$opt_vardir/ndbcluster-$opt_ndbcluster_port");
|
||||||
rmtree("$opt_vardir/run");
|
rmtree("$opt_vardir/run");
|
||||||
@ -1722,6 +1724,11 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--local-infile", $prefix);
|
mtr_add_arg($args, "%s--local-infile", $prefix);
|
||||||
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
mtr_add_arg($args, "%s--datadir=%s", $prefix,
|
||||||
$master->[$idx]->{'path_myddir'});
|
$master->[$idx]->{'path_myddir'});
|
||||||
|
|
||||||
|
if ( $opt_skip_ndbcluster )
|
||||||
|
{
|
||||||
|
mtr_add_arg($args, "%s--skip-ndbcluster", $prefix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $type eq 'slave' )
|
if ( $type eq 'slave' )
|
||||||
@ -1862,19 +1869,11 @@ sub mysqld_arguments ($$$$$) {
|
|||||||
mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
|
mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
|
||||||
mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
|
mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
|
||||||
}
|
}
|
||||||
else
|
elsif ( $type eq 'master' )
|
||||||
{
|
{
|
||||||
mtr_add_arg($args, "%s--exit-info=256", $prefix);
|
mtr_add_arg($args, "%s--exit-info=256", $prefix);
|
||||||
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
|
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
|
||||||
|
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
|
||||||
if ( $type eq 'master' )
|
|
||||||
{
|
|
||||||
mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'});
|
|
||||||
}
|
|
||||||
if ( $type eq 'slave' )
|
|
||||||
{
|
|
||||||
mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $args;
|
return $args;
|
||||||
|
Reference in New Issue
Block a user