From 59574a6e601d6725492d9283a3d386df16eace32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Nov 2007 13:29:31 +0100 Subject: WL#3949 Test should set binlog format dnamically - Reorganize collect a little to make it easier to apply optimizations and settings to collected test cases. - Add suite/rpl/combination file - Rename include/set_binlog_format_x.inc to .sql since thay are run by "mysql" mysql-test/include/set_binlog_format_mixed.sql: Rename: mysql-test/include/set_binlog_format_mixed.inc -> mysql-test/include/set_binlog_format_mixed.sql mysql-test/include/set_binlog_format_row.sql: Rename: mysql-test/include/set_binlog_format_row.inc -> mysql-test/include/set_binlog_format_row.sql mysql-test/include/set_binlog_format_statement.sql: Rename: mysql-test/include/set_binlog_format_statement.inc -> mysql-test/include/set_binlog_format_statement.sql mysql-test/lib/mtr_cases.pl: Reorganize code to - collect a suite - multiply the tests in the suite with any combinations the suite has - optimize the suite by skipping test not supported with current settings Use My::Config to read combinations file in my.cnf file format, this allowas a "short name" to be used for the combination instead of the full name wich is set to the extra arguments the combination applies Add function 'print_testcase' that can be used to print the testcases during different stages of the collect phase mysql-test/lib/mtr_report.pl: Print '' if combination is set mysql-test/mysql-test-run.pl: Add comments, fix indentation Rename .in to .sql files Only set binlog format dynamicall for master, slav is always restarted mysql-test/lib/My/Config.pm: New BitKeeper file ``mysql-test/lib/My/Config.pm'' mysql-test/suite/rpl/combinations: New BitKeeper file ``mysql-test/suite/rpl/combinations'' --- mysql-test/mysql-test-run.pl | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e17bbeb251f..490eaabc37e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -164,7 +164,7 @@ our $opt_bench= 0; our $opt_small_bench= 0; our $opt_big_test= 0; -our @opt_combination; +our @opt_combinations; our $opt_skip_combination; our @opt_extra_mysqld_opt; @@ -532,7 +532,7 @@ sub command_line_setup () { 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, 'big-test' => \$opt_big_test, - 'combination=s' => \@opt_combination, + 'combination=s' => \@opt_combinations, 'skip-combination' => \$opt_skip_combination, # Specify ports @@ -928,6 +928,10 @@ sub command_line_setup () { mtr_error("Will not run in record mode without a specific test case"); } + if ( $opt_record ) + { + $opt_skip_combination = 1; + } # -------------------------------------------------------------------------- # ps protcol flag @@ -3330,24 +3334,26 @@ sub do_before_run_mysqltest($) # if script decided to run mysqltest cluster _is_ installed ok $ENV{'NDB_STATUS_OK'} = "YES"; } - if (defined $tinfo->{"binlog_format"} and $mysql_version_id > 50100 ) + if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 ) { - foreach my $server ((@$master,@$slave)) + # Dynamically switch binlog format of + # master, slave is always restarted + foreach my $server ( @$master ) { - if ($server->{'pid'}) - { - - mtr_init_args(\$args); + next unless ($server->{'pid'}); - mtr_add_arg($args, "--no-defaults"); - - mtr_add_arg($args, "--user=root"); - mtr_add_arg($args, "--port=$server->{'port'}"); - mtr_add_arg($args, "--socket=$server->{'path_sock'}"); - - mtr_run($exe_mysql, $args, "include/set_binlog_format_".$tinfo->{"binlog_format"}.".inc", "", "", ""); + mtr_init_args(\$args); + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--user=root"); + mtr_add_arg($args, "--port=$server->{'port'}"); + mtr_add_arg($args, "--socket=$server->{'path_sock'}"); - } + my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql"; + mtr_verbose("Setting binlog format:", $tinfo->{binlog_format}); + if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0) + { + mtr_error("Failed to switch binlog format"); + } } } } @@ -5179,8 +5185,8 @@ Options to control what test suites or cases to run skip-im Don't start IM, and skip the IM test cases big-test Set the environment variable BIG_TEST, which can be checked from test cases. - combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one - combination. + combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one + combination. skip-combination Skip any combination options and combinations files Options that specify ports -- cgit v1.2.1