Cleanup formatting

parent 7f1d1586
...@@ -1278,3 +1278,6 @@ include/openssl ...@@ -1278,3 +1278,6 @@ include/openssl
mysql-test/r/bdb.log mysql-test/r/bdb.log
mysql-test/r/im_client_port.log mysql-test/r/im_client_port.log
mysql-test/r/udf.log mysql-test/r/udf.log
extra/yassl/taocrypt/benchmark/benchmark
extra/yassl/taocrypt/test/test
extra/yassl/testsuite/testsuite
...@@ -1223,6 +1223,7 @@ sub signal_setup () { ...@@ -1223,6 +1223,7 @@ sub signal_setup () {
$SIG{INT}= \&handle_int_signal; $SIG{INT}= \&handle_int_signal;
} }
sub handle_int_signal () { sub handle_int_signal () {
$SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die... $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die...
mtr_warning("got INT signal, cleaning up....."); mtr_warning("got INT signal, cleaning up.....");
...@@ -1438,7 +1439,6 @@ sub check_ndbcluster_support () { ...@@ -1438,7 +1439,6 @@ sub check_ndbcluster_support () {
return; return;
} }
# FIXME why is there a different start below?!
sub ndbcluster_install () { sub ndbcluster_install () {
...@@ -1465,6 +1465,7 @@ sub ndbcluster_install () { ...@@ -1465,6 +1465,7 @@ sub ndbcluster_install () {
return 0; return 0;
} }
sub ndbcluster_start ($) { sub ndbcluster_start ($) {
my $use_ndbcluster= shift; my $use_ndbcluster= shift;
...@@ -1497,6 +1498,7 @@ sub ndbcluster_start ($) { ...@@ -1497,6 +1498,7 @@ sub ndbcluster_start ($) {
return 0; return 0;
} }
sub ndbcluster_stop () { sub ndbcluster_stop () {
if ( ! $using_ndbcluster_master or $glob_use_running_ndbcluster ) if ( ! $using_ndbcluster_master or $glob_use_running_ndbcluster )
{ {
...@@ -1594,6 +1596,7 @@ sub run_tests () { ...@@ -1594,6 +1596,7 @@ sub run_tests () {
run_suite($opt_suite); run_suite($opt_suite);
} }
sub run_suite () { sub run_suite () {
my $suite= shift; my $suite= shift;
...@@ -1756,15 +1759,15 @@ sub im_create_passwd_file($) { ...@@ -1756,15 +1759,15 @@ sub im_create_passwd_file($) {
my $instance_manager = shift; my $instance_manager = shift;
my $pwd_file_path = $instance_manager->{'password_file'}; my $pwd_file_path = $instance_manager->{'password_file'};
mtr_report("Creating IM password file ($pwd_file_path)"); mtr_report("Creating IM password file ($pwd_file_path)");
open(OUT, ">", $pwd_file_path) open(OUT, ">", $pwd_file_path)
or mtr_error("Can't write to $pwd_file_path: $!"); or mtr_error("Can't write to $pwd_file_path: $!");
print OUT $instance_manager->{'admin_login'}, ":", print OUT $instance_manager->{'admin_login'}, ":",
$instance_manager->{'admin_sha1'}, "\n"; $instance_manager->{'admin_sha1'}, "\n";
close(OUT); close(OUT);
} }
...@@ -1776,7 +1779,7 @@ sub im_create_defaults_file($) { ...@@ -1776,7 +1779,7 @@ sub im_create_defaults_file($) {
open(OUT, ">", $defaults_file) open(OUT, ">", $defaults_file)
or mtr_error("Can't write to $defaults_file: $!"); or mtr_error("Can't write to $defaults_file: $!");
print OUT <<EOF print OUT <<EOF
[mysql] [mysql]
...@@ -1934,7 +1937,7 @@ sub run_testcase ($) { ...@@ -1934,7 +1937,7 @@ sub run_testcase ($) {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
stop_slaves(); stop_slaves();
} }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Prepare to start masters. Even if we use embedded, we want to run # Prepare to start masters. Even if we use embedded, we want to run
...@@ -1947,9 +1950,9 @@ sub run_testcase ($) { ...@@ -1947,9 +1950,9 @@ sub run_testcase ($) {
mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
# FIXME test cases that depend on each other, prevent this from # FIXME test cases that depend on each other, prevent this from
# being at this location. # being at this location.
# do_before_start_master($tname,$tinfo->{'master_sh'}); # do_before_start_master($tname,$tinfo->{'master_sh'});
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# If any mysqld servers running died, we have to know # If any mysqld servers running died, we have to know
...@@ -2125,6 +2128,7 @@ sub run_testcase ($) { ...@@ -2125,6 +2128,7 @@ sub run_testcase ($) {
} }
} }
# #
# Save a snapshot of the installed test db(s) # Save a snapshot of the installed test db(s)
# I.e take a snapshot of the var/ dir # I.e take a snapshot of the var/ dir
...@@ -2161,6 +2165,7 @@ sub save_files_before_restore($$) { ...@@ -2161,6 +2165,7 @@ sub save_files_before_restore($$) {
} }
} }
# #
# Restore snapshot of the installed test db(s) # Restore snapshot of the installed test db(s)
# if the snapshot exists # if the snapshot exists
...@@ -2230,9 +2235,9 @@ sub report_failure_and_restart ($) { ...@@ -2230,9 +2235,9 @@ sub report_failure_and_restart ($) {
# #
############################################################################## ##############################################################################
# The embedded server needs the cleanup so we do some of the start work # The embedded server needs the cleanup so we do some of the start work
# but stop before actually running mysqld or anything. # but stop before actually running mysqld or anything.
sub do_before_start_master ($$) { sub do_before_start_master ($$) {
my $tname= shift; my $tname= shift;
my $init_script= shift; my $init_script= shift;
...@@ -2265,13 +2270,14 @@ sub do_before_start_master ($$) { ...@@ -2265,13 +2270,14 @@ sub do_before_start_master ($$) {
if ( $ret != 0 ) if ( $ret != 0 )
{ {
# FIXME rewrite those scripts to return 0 if successful # FIXME rewrite those scripts to return 0 if successful
# mtr_warning("$init_script exited with code $ret"); # mtr_warning("$init_script exited with code $ret");
} }
} }
# for gcov FIXME needed? If so we need more absolute paths # for gcov FIXME needed? If so we need more absolute paths
# chdir($glob_basedir); # chdir($glob_basedir);
} }
sub do_before_start_slave ($$) { sub do_before_start_slave ($$) {
my $tname= shift; my $tname= shift;
my $init_script= shift; my $init_script= shift;
...@@ -2299,7 +2305,7 @@ sub do_before_start_slave ($$) { ...@@ -2299,7 +2305,7 @@ sub do_before_start_slave ($$) {
if ( $ret != 0 ) if ( $ret != 0 )
{ {
# FIXME rewrite those scripts to return 0 if successful # FIXME rewrite those scripts to return 0 if successful
# mtr_warning("$init_script exited with code $ret"); # mtr_warning("$init_script exited with code $ret");
} }
} }
...@@ -2309,6 +2315,7 @@ sub do_before_start_slave ($$) { ...@@ -2309,6 +2315,7 @@ sub do_before_start_slave ($$) {
} }
} }
sub mysqld_arguments ($$$$$$) { sub mysqld_arguments ($$$$$$) {
my $args= shift; my $args= shift;
my $type= shift; # master/slave/bootstrap my $type= shift; # master/slave/bootstrap
...@@ -2532,14 +2539,6 @@ sub mysqld_arguments ($$$$$$) { ...@@ -2532,14 +2539,6 @@ sub mysqld_arguments ($$$$$$) {
return $args; return $args;
} }
# FIXME
# if ( $type eq 'master' and $glob_use_embedded_server )
# {
# # Add a -A to each argument to pass it to embedded server
# my @mysqltest_opt= map {("-A",$_)} @args;
# $opt_extra_mysqltest_opt= \@mysqltest_opt;
# return;
# }
############################################################################## ##############################################################################
# #
...@@ -2639,6 +2638,7 @@ sub mysqld_start ($$$$$) { ...@@ -2639,6 +2638,7 @@ sub mysqld_start ($$$$$) {
return 0; return 0;
} }
sub stop_masters_slaves () { sub stop_masters_slaves () {
print "Ending Tests\n"; print "Ending Tests\n";
...@@ -2648,7 +2648,7 @@ sub stop_masters_slaves () { ...@@ -2648,7 +2648,7 @@ sub stop_masters_slaves () {
print "Shutting-down Instance Manager\n"; print "Shutting-down Instance Manager\n";
im_stop($instance_manager); im_stop($instance_manager);
} }
print "Shutting-down MySQL daemon\n\n"; print "Shutting-down MySQL daemon\n\n";
stop_masters(); stop_masters();
print "Master(s) shutdown finished\n"; print "Master(s) shutdown finished\n";
...@@ -2656,6 +2656,7 @@ sub stop_masters_slaves () { ...@@ -2656,6 +2656,7 @@ sub stop_masters_slaves () {
print "Slave(s) shutdown finished\n"; print "Slave(s) shutdown finished\n";
} }
sub stop_masters () { sub stop_masters () {
my @args; my @args;
...@@ -2685,6 +2686,7 @@ sub stop_masters () { ...@@ -2685,6 +2686,7 @@ sub stop_masters () {
mtr_stop_mysqld_servers(\@args); mtr_stop_mysqld_servers(\@args);
} }
sub stop_slaves () { sub stop_slaves () {
my $force= shift; my $force= shift;
...@@ -2727,7 +2729,7 @@ sub im_start($$) { ...@@ -2727,7 +2729,7 @@ sub im_start($$) {
mtr_add_arg($args, $opt); mtr_add_arg($args, $opt);
} }
$instance_manager->{'pid'} = $instance_manager->{'pid'} =
mtr_spawn( mtr_spawn(
$exe_im, # path to the executable $exe_im, # path to the executable
$args, # cmd-line args $args, # cmd-line args
...@@ -2743,7 +2745,7 @@ sub im_start($$) { ...@@ -2743,7 +2745,7 @@ sub im_start($$) {
mtr_report('Could not start Instance Manager'); mtr_report('Could not start Instance Manager');
return; return;
} }
# Instance Manager can be run in daemon mode. In this case, it creates # Instance Manager can be run in daemon mode. In this case, it creates
# several processes and the parent process, created by mtr_spawn(), exits just # several processes and the parent process, created by mtr_spawn(), exits just
# after start. So, we have to obtain Instance Manager PID from the PID file. # after start. So, we have to obtain Instance Manager PID from the PID file.
...@@ -2761,6 +2763,7 @@ sub im_start($$) { ...@@ -2761,6 +2763,7 @@ sub im_start($$) {
mtr_get_pid_from_file($instance_manager->{'path_pid'}); mtr_get_pid_from_file($instance_manager->{'path_pid'});
} }
sub im_stop($) { sub im_stop($) {
my $instance_manager = shift; my $instance_manager = shift;
...@@ -2795,12 +2798,13 @@ sub im_stop($) { ...@@ -2795,12 +2798,13 @@ sub im_stop($) {
# Kill processes. # Kill processes.
mtr_kill_processes(\@pids); mtr_kill_processes(\@pids);
stop_reap_all(); stop_reap_all();
$instance_manager->{'pid'} = undef; $instance_manager->{'pid'} = undef;
} }
# #
# Run include/check-testcase.test # Run include/check-testcase.test
# Before a testcase, run in record mode, save result file to var # Before a testcase, run in record mode, save result file to var
...@@ -2849,6 +2853,7 @@ sub run_check_testcase ($) { ...@@ -2849,6 +2853,7 @@ sub run_check_testcase ($) {
} }
} }
sub run_mysqltest ($) { sub run_mysqltest ($) {
my $tinfo= shift; my $tinfo= shift;
...@@ -3185,6 +3190,7 @@ sub gdb_arguments { ...@@ -3185,6 +3190,7 @@ sub gdb_arguments {
$$exe= "xterm"; $$exe= "xterm";
} }
# #
# Modify the exe and args so that program is run in ddd # Modify the exe and args so that program is run in ddd
# #
...@@ -3430,18 +3436,18 @@ Deprecated options ...@@ -3430,18 +3436,18 @@ Deprecated options
Options not yet described, or that I want to look into more Options not yet described, or that I want to look into more
big-test big-test
debug debug
local local
local-master local-master
netware netware
old-master old-master
sleep=SECONDS sleep=SECONDS
socket=PATH socket=PATH
user-test=s user-test=s
wait-timeout=SECONDS wait-timeout=SECONDS
warnings warnings
log-warnings log-warnings
HERE HERE
mtr_exit(1); mtr_exit(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