Commit 39655092 authored by Bjorn Munch's avatar Bjorn Munch

merge 59148,59489

parents c2f4219a 33f1e8e4
# -*- cperl -*- # -*- cperl -*-
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public # modify it under the terms of the GNU Library General Public
...@@ -139,6 +139,7 @@ sub new { ...@@ -139,6 +139,7 @@ sub new {
my $host = delete($opts{'host'}); my $host = delete($opts{'host'});
my $shutdown = delete($opts{'shutdown'}); my $shutdown = delete($opts{'shutdown'});
my $user_data= delete($opts{'user_data'}); my $user_data= delete($opts{'user_data'});
my $envs = delete($opts{'envs'});
# if (defined $host) { # if (defined $host) {
# $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl"; # $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl";
...@@ -161,6 +162,13 @@ sub new { ...@@ -161,6 +162,13 @@ sub new {
# Point the safe_process at the right parent if running on cygwin # Point the safe_process at the right parent if running on cygwin
push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN; push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
foreach my $env_var (@$envs) {
croak("Missing = in env string") unless $env_var =~ /=/;
croak("Env string $env_var seen, probably missing value for --mysqld-env")
if $env_var =~ /^--/;
push @safe_args, "--env $env_var";
}
push(@safe_args, "--"); push(@safe_args, "--");
push(@safe_args, $path); # The program safe_process should execute push(@safe_args, $path); # The program safe_process should execute
......
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -175,7 +175,7 @@ int main(int argc, char* const argv[] ) ...@@ -175,7 +175,7 @@ int main(int argc, char* const argv[] )
} else { } else {
if ( strcmp(arg, "--verbose") == 0 ) if ( strcmp(arg, "--verbose") == 0 )
verbose++; verbose++;
else if ( strncmp(arg, "--parent-pid", 10) == 0 ) else if ( strncmp(arg, "--parent-pid", 12) == 0 )
{ {
/* Override parent_pid with a value provided by user */ /* Override parent_pid with a value provided by user */
const char* start; const char* start;
...@@ -184,10 +184,15 @@ int main(int argc, char* const argv[] ) ...@@ -184,10 +184,15 @@ int main(int argc, char* const argv[] )
start++; /* Step past = */ start++; /* Step past = */
if ((parent_pid= atoi(start)) == 0) if ((parent_pid= atoi(start)) == 0)
die("Invalid value '%s' passed to --parent-id", start); die("Invalid value '%s' passed to --parent-id", start);
} else if ( strcmp(arg, "--nocore") == 0 ) }
else if ( strcmp(arg, "--nocore") == 0 )
{ {
nocore = true; // Don't allow the process to dump core nocore = true; // Don't allow the process to dump core
} }
else if ( strncmp (arg, "--env ", 6) == 0 )
{
putenv(strdup(arg+6));
}
else else
die("Unknown option: %s", arg); die("Unknown option: %s", arg);
} }
......
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -220,6 +220,10 @@ int main(int argc, const char** argv ) ...@@ -220,6 +220,10 @@ int main(int argc, const char** argv )
{ {
nocore= TRUE; nocore= TRUE;
} }
else if ( strncmp (arg, "--env ", 6) == 0 )
{
putenv(strdup(arg+6));
}
else else
die("Unknown option: %s", arg); die("Unknown option: %s", arg);
} }
......
...@@ -176,6 +176,7 @@ our $opt_big_test= 0; ...@@ -176,6 +176,7 @@ our $opt_big_test= 0;
our @opt_combinations; our @opt_combinations;
our @opt_extra_mysqld_opt; our @opt_extra_mysqld_opt;
our @opt_mysqld_envs;
my $opt_compress; my $opt_compress;
my $opt_ssl; my $opt_ssl;
...@@ -416,6 +417,14 @@ sub main { ...@@ -416,6 +417,14 @@ sub main {
my $server_port = $server->sockport(); my $server_port = $server->sockport();
mtr_report("Using server port $server_port"); mtr_report("Using server port $server_port");
# --------------------------------------------------------------------------
# Read definitions from include/plugin.defs
#
read_plugin_defs("include/plugin.defs");
# Simplify reference to semisync plugins
$ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'};
# Create child processes # Create child processes
my %children; my %children;
for my $child_num (1..$opt_parallel){ for my $child_num (1..$opt_parallel){
...@@ -962,6 +971,7 @@ sub command_line_setup { ...@@ -962,6 +971,7 @@ sub command_line_setup {
# Extra options used when starting mysqld # Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt, 'mysqld=s' => \@opt_extra_mysqld_opt,
'mysqld-env=s' => \@opt_mysqld_envs,
# Run test on running server # Run test on running server
'extern=s' => \%opts_extern, # Append to hash 'extern=s' => \%opts_extern, # Append to hash
...@@ -1981,13 +1991,13 @@ sub find_plugin($$) ...@@ -1981,13 +1991,13 @@ sub find_plugin($$)
$plugin_filename = $plugin.".so"; $plugin_filename = $plugin.".so";
} }
my $lib_example_plugin= my $lib_plugin=
mtr_file_exists(vs_config_dirs($location,$plugin_filename), mtr_file_exists(vs_config_dirs($location,$plugin_filename),
"$basedir/lib/plugin/".$plugin_filename, "$basedir/lib/plugin/".$plugin_filename,
"$basedir/$location/.libs/".$plugin_filename, "$basedir/$location/.libs/".$plugin_filename,
"$basedir/lib/mysql/plugin/".$plugin_filename, "$basedir/lib/mysql/plugin/".$plugin_filename,
); );
return $lib_example_plugin; return $lib_plugin;
} }
# #
...@@ -1997,10 +2007,16 @@ sub find_plugin($$) ...@@ -1997,10 +2007,16 @@ sub find_plugin($$)
sub read_plugin_defs($) sub read_plugin_defs($)
{ {
my ($defs_file)= @_; my ($defs_file)= @_;
my $running_debug= 0;
open(PLUGDEF, '<', $defs_file) open(PLUGDEF, '<', $defs_file)
or mtr_error("Can't read plugin defintions file $defs_file"); or mtr_error("Can't read plugin defintions file $defs_file");
# Need to check if we will be running mysqld-debug
if ($opt_debug) {
$running_debug= 1 if find_mysqld($basedir) =~ /-debug$/;
}
while (<PLUGDEF>) { while (<PLUGDEF>) {
next if /^#/; next if /^#/;
my ($plug_file, $plug_loc, $plug_var, $plug_names)= split; my ($plug_file, $plug_loc, $plug_var, $plug_names)= split;
...@@ -2008,6 +2024,9 @@ sub read_plugin_defs($) ...@@ -2008,6 +2024,9 @@ sub read_plugin_defs($)
next unless $plug_file; next unless $plug_file;
mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var; mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var;
# If running debug server, plugins will be in 'debug' subdirectory
$plug_file= "debug/$plug_file" if $running_debug;
my ($plugin)= find_plugin($plug_file, $plug_loc); my ($plugin)= find_plugin($plug_file, $plug_loc);
# Set env. variables that tests may use, set to empty if plugin # Set env. variables that tests may use, set to empty if plugin
...@@ -2072,18 +2091,9 @@ sub environment_setup { ...@@ -2072,18 +2091,9 @@ sub environment_setup {
push(@ld_library_paths, "$basedir/storage/ndb/src/.libs"); push(@ld_library_paths, "$basedir/storage/ndb/src/.libs");
} }
# --------------------------------------------------------------------------
# Read definitions from include/plugin.defs
#
# Plugin settings should no longer be added here, instead # Plugin settings should no longer be added here, instead
# place definitions in include/plugin.defs. # place definitions in include/plugin.defs.
# See comment in that file for details. # See comment in that file for details.
# --------------------------------------------------------------------------
read_plugin_defs("include/plugin.defs");
# Simplify reference to semisync plugins
$ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'};
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost # Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug" # impossible to add correct supressions, that means if "/usr/lib/debug"
...@@ -4710,6 +4720,7 @@ sub mysqld_start ($$) { ...@@ -4710,6 +4720,7 @@ sub mysqld_start ($$) {
nocore => $opt_skip_core, nocore => $opt_skip_core,
host => undef, host => undef,
shutdown => sub { mysqld_stop($mysqld) }, shutdown => sub { mysqld_stop($mysqld) },
envs => \@opt_mysqld_envs,
); );
mtr_verbose("Started $mysqld->{proc}"); mtr_verbose("Started $mysqld->{proc}");
} }
...@@ -5724,9 +5735,10 @@ Options for test case authoring ...@@ -5724,9 +5735,10 @@ Options for test case authoring
check-testcases Check testcases for sideeffects check-testcases Check testcases for sideeffects
mark-progress Log line number and elapsed time to <testname>.progress mark-progress Log line number and elapsed time to <testname>.progress
Options that pass on options Options that pass on options (these may be repeated)
mysqld=ARGS Specify additional arguments to "mysqld" mysqld=ARGS Specify additional arguments to "mysqld"
mysqld-env=VAR=VAL Specify additional environment settings for "mysqld"
Options to run test on running server Options to run test on running server
......
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