From a7ef3df74112a3f880f89472dd97e0a361ed0368 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Oct 2005 13:35:36 +0200 Subject: Change the "Password" column type for the Perl suite running the tests. bug#14023 mysql-test/lib/init_db.sql: Data type of the "Password" column has been changed in "mysql_create_system_tables", this must be reflected here (until they are united). bug#14023 --- mysql-test/lib/init_db.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index b366a429ab2..fd7b035e038 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -62,7 +62,7 @@ comment='Host privileges; Merged with database privileges'; CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, - Password binary(41) DEFAULT '' NOT NULL, + Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, -- cgit v1.2.1 From b26f6799d8d0dbfbeaa7a27701f230fd7529b498 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Oct 2005 06:49:19 +0200 Subject: thread_registry.h, thread_registry.cc: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX Makefile.am: Preserve executable mode on scripts make_binary_distribution.sh: Copy *.imtest files scripts/make_binary_distribution.sh: Copy *.imtest files mysql-test/Makefile.am: Preserve executable mode on scripts server-tools/instance-manager/thread_registry.cc: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX server-tools/instance-manager/thread_registry.h: Add explicit Thread_info::Thread_info() and move both initializers out of class definition, to solve link problem on QNX --- mysql-test/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 1fb5f82c475..f1194d7fc2f 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -53,7 +53,8 @@ dist-hook: -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data @@ -79,7 +80,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r -- cgit v1.2.1 From 924aa6a91ebee6b4494dc4cb1278e732a757732c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Oct 2005 17:05:14 +0200 Subject: mysql-test-run.pl: Put socket files into $opt_tmpdir, to avoid problems with platforms that can't handle long socket paths. mysql-test/mysql-test-run.pl: Put socket files into $opt_tmpdir, to avoid problems with platforms that can't handle long socket paths. --- mysql-test/mysql-test-run.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 05e6169b4c7..92d8c8f1139 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -840,8 +840,8 @@ sub command_line_setup () { server_id => 1, port => $im_mysqld1_port, path_datadir => "$opt_vardir/im_mysqld_1.data", - path_sock => "$opt_vardir/mysqld_1.sock", - path_pid => "$opt_vardir/mysqld_1.pid", + path_sock => "$opt_tmpdir/mysqld_1.sock", + path_pid => "$opt_vardir/run/mysqld_1.pid", }; $instance_manager->{'instances'}->[1]= @@ -849,8 +849,8 @@ sub command_line_setup () { server_id => 2, port => $im_mysqld2_port, path_datadir => "$opt_vardir/im_mysqld_2.data", - path_sock => "$opt_vardir/mysqld_2.sock", - path_pid => "$opt_vardir/mysqld_2.pid", + path_sock => "$opt_tmpdir/mysqld_2.sock", + path_pid => "$opt_vardir/run/mysqld_2.pid", nonguarded => 1, }; -- cgit v1.2.1 From 40e9c83d5d11fdc5454830fedced9598dcff352c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Oct 2005 19:30:10 +0400 Subject: portability fix: sh does not support "==". This resulted in IM tests failing on range of platforms. --- mysql-test/t/kill_n_check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/t/kill_n_check.sh index 7fe30c4774c..e722b3a180d 100755 --- a/mysql-test/t/kill_n_check.sh +++ b/mysql-test/t/kill_n_check.sh @@ -39,7 +39,7 @@ new_pid="" # echo "New PID: $new_pid" -if [ "$expected_result" == "restarted" ]; then +if [ "$expected_result" = "restarted" ]; then if [ -z "$new_pid" ]; then echo "Error: the process was killed." @@ -54,7 +54,7 @@ if [ "$expected_result" == "restarted" ]; then echo "Success: the process was restarted." exit 0 -else # $expected_result == killed +else # $expected_result = killed if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then echo "Error: the process was restarted." -- cgit v1.2.1 From c1e49b547f7968fafba2b474f1e11a1b1db301ab Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Oct 2005 20:51:19 +0200 Subject: mysql-test-run.pl: Added --skip-im option handling Don't terminate script if IM fails to create PID file mtr_cases.pl: Added --skip-im option handling mtr_process.pl: Kill left over 'mysqld' processes started by IM mysql-test/lib/mtr_process.pl: Kill left over 'mysqld' processes started by IM mysql-test/lib/mtr_cases.pl: Added --skip-im option handling mysql-test/mysql-test-run.pl: Added --skip-im option handling Don't terminate script if IM fails to create PID file --- mysql-test/lib/mtr_cases.pl | 8 +++---- mysql-test/lib/mtr_process.pl | 11 +++++++++ mysql-test/mysql-test-run.pl | 55 ++++++++++++++++++++----------------------- 3 files changed, 40 insertions(+), 34 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index ca984d37ecf..fb622f2bbb3 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -68,7 +68,7 @@ sub collect_test_cases ($) { # # Otherwise, try to guess the target component. - if ( defined $component_id ) + if ( $component_id ) { if ( ! -f "$testdir/$elem") { @@ -80,11 +80,11 @@ sub collect_test_cases ($) { my $mysqld_test_exists = -f "$testdir/$tname.test"; my $im_test_exists = -f "$testdir/$tname.imtest"; - if ( $mysqld_test_exists && $im_test_exists ) + if ( $mysqld_test_exists and $im_test_exists ) { mtr_error("Ambiguos test case name ($tname)"); } - elsif ( ! $mysqld_test_exists && !$im_test_exists ) + elsif ( ! $mysqld_test_exists and ! $im_test_exists ) { mtr_error("Test case $tname is not found"); } @@ -405,7 +405,7 @@ sub collect_one_test_case($$$$$$$) { "Instance Manager tests are not run with --ps-protocol. " . "Test case '$tname' is skipped."); } - elsif ( !$::exe_im ) + elsif ( $::opt_skip_im ) { $tinfo->{'skip'}= 1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index eb60df4a5cb..b3a243444c1 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -360,9 +360,20 @@ sub mtr_kill_leftovers () { # First, kill all masters and slaves that would conflict with # this run. Make sure to remove the PID file, if any. + # FIXME kill IM manager first, else it will restart the servers, how?! my @args; + for ( my $idx; $idx < 2; $idx++ ) + { + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::instance_manager->{'instances'}->[$idx]->{'path_pid'}, + sockfile => $::instance_manager->{'instances'}->[$idx]->{'path_sock'}, + port => $::instance_manager->{'instances'}->[$idx]->{'port'}, + }); + } + for ( my $idx; $idx < 2; $idx++ ) { push(@args,{ diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 92d8c8f1139..35f26199fc8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -233,6 +233,7 @@ our $opt_result_ext; our $opt_skip; our $opt_skip_rpl; our $opt_skip_test; +our $opt_skip_im; our $opt_sleep; our $opt_ps_protocol; @@ -490,6 +491,7 @@ sub command_line_setup () { 'do-test=s' => \$opt_do_test, 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, + 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, # Specify ports @@ -1118,7 +1120,7 @@ sub kill_and_cleanup () { foreach my $instance (@{$instance_manager->{'instances'}}) { - push (@data_dir_lst, $instance->{'path_datadir'}); + push(@data_dir_lst, $instance->{'path_datadir'}); } foreach my $data_dir (@data_dir_lst) @@ -1364,7 +1366,7 @@ sub mysql_install_db () { install_db('slave', $slave->[1]->{'path_myddir'}); install_db('slave', $slave->[2]->{'path_myddir'}); - if ( defined $exe_im) + if ( ! $opt_skip_im ) { im_prepare_env($instance_manager); } @@ -1513,12 +1515,7 @@ skip-ndbcluster EOF ; - if ( exists $instance->{nonguarded} and - defined $instance->{nonguarded} ) - { - print OUT "nonguarded\n"; - } - + print OUT "nonguarded\n" if $instance->{'nonguarded'}; print OUT "\n"; } @@ -1678,7 +1675,7 @@ sub run_testcase ($) { $master->[0]->{'running_master_is_special'}= 1; } } - elsif ( $tinfo->{'component_id'} eq 'im') + elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' ) { # We have to create defaults file every time, in order to ensure that it # will be the same for each test. The problem is that test can change the @@ -1776,7 +1773,8 @@ sub run_testcase ($) { # Stop Instance Manager if we are processing an IM-test case. # ---------------------------------------------------------------------- - if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' ) + if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' and + $instance_manager->{'pid'} ) { im_stop($instance_manager); } @@ -2195,7 +2193,7 @@ sub stop_masters_slaves () { print "Ending Tests\n"; - if (defined $instance_manager->{'pid'}) + if ( $instance_manager->{'pid'} ) { print "Shutting-down Instance Manager\n"; im_stop($instance_manager); @@ -2269,14 +2267,10 @@ sub im_start($$) { my $instance_manager = shift; my $opts = shift; - if ( ! defined $exe_im) - { - return; - } - my $args; mtr_init_args(\$args); - mtr_add_arg($args, "--defaults-file=" . $instance_manager->{'defaults_file'}); + mtr_add_arg($args, "--defaults-file=%s", + $instance_manager->{'defaults_file'}); foreach my $opt (@{$opts}) { @@ -2294,7 +2288,7 @@ sub im_start($$) { { append_log_file => 1 } # append log files ); - if ( ! defined $instance_manager->{'pid'} ) + if ( ! $instance_manager->{'pid'} ) { mtr_report('Could not start Instance Manager'); return; @@ -2304,10 +2298,14 @@ sub im_start($$) { # 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. - sleep_until_file_created( - $instance_manager->{'path_pid'}, - $instance_manager->{'start_timeout'}, - -1); # real PID is still unknown + if ( ! sleep_until_file_created( + $instance_manager->{'path_pid'}, + $instance_manager->{'start_timeout'}, + -1)) # real PID is still unknown + { + mtr_report("Instance Manager PID file is missing"); + return; + } $instance_manager->{'pid'} = mtr_get_pid_from_file($instance_manager->{'path_pid'}); @@ -2316,16 +2314,12 @@ sub im_start($$) { sub im_stop($) { my $instance_manager = shift; - if (! defined $instance_manager->{'pid'}) - { - return; - } - # Re-read pid from the file, since during tests Instance Manager could have # been restarted, so its pid could have been changed. $instance_manager->{'pid'} = - mtr_get_pid_from_file($instance_manager->{'path_pid'}); + mtr_get_pid_from_file($instance_manager->{'path_pid'}) + if -f $instance_manager->{'path_pid'}; # Inspired from mtr_stop_mysqld_servers(). @@ -2340,12 +2334,12 @@ sub im_stop($) { if ( -r $instances->[0]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'})); } if ( -r $instances->[1]->{'path_pid'} ) { - push @pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'}); + push(@pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'})); } # Kill processes. @@ -2601,6 +2595,7 @@ Options to control what test suites or cases to run start-from=PREFIX Run test cases starting from test prefixed with PREFIX suite=NAME Run the test suite named NAME. The default is "main" skip-rpl Skip the replication test cases. + skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX Options that specify ports -- cgit v1.2.1