9
11
# Tool used for executing a suite of .test file
11
# See the "MySQL Test framework manual" for more information
12
# http://dev.mysql.com/doc/drizzletest/en/index.html
13
# For now, see the "MySQL Test framework manual" for more information
14
# http://dev.mysql.com/doc/mysqltest/en/index.html
15
# (as the Drizzle test environment is currently still fairly similar)
14
17
# Please keep the test framework tools identical in all versions!
115
119
our $opt_vardir; # A path but set directly on cmd line
116
120
our $path_vardir_trace; # unix formatted opt_vardir for trace files
117
121
our $opt_tmpdir; # A path but set directly on cmd line
120
125
our $default_vardir;
124
our $opt_suites_default= "main,binlog,rpl"; # Default suites to run
129
our $opt_suites_default= "main"; # Default suites to run
125
130
our $opt_script_debug= 0; # Script debugging, enable with --script-debug
126
131
our $opt_verbose= 0; # Verbose output, enable with --verbose
133
our $opt_repeat_test= 1;
128
135
our $exe_master_mysqld;
129
136
our $exe_drizzle;
130
our $exe_drizzleadmin;
131
our $exe_drizzlebinlog;
132
137
our $exe_drizzle_client_test;
133
138
our $exe_bug25714;
134
139
our $exe_drizzled;
135
140
our $exe_drizzlecheck;
136
141
our $exe_drizzledump;
142
our $exe_drizzleslap;
138
143
our $exe_drizzleimport;
139
144
our $exe_drizzle_fix_system_tables;
140
145
our $exe_drizzletest;
423
# Magic number -69.4 results in traditional test ports starting from 9306.
424
set_mtr_build_thread_ports(-69.4);
426
426
# If so requested, we try to avail ourselves of a unique build thread number.
427
427
if ( $ENV{'MTR_BUILD_THREAD'} ) {
428
428
if ( lc($ENV{'MTR_BUILD_THREAD'}) eq 'auto' ) {
465
465
# Control what test suites or cases to run
466
466
'force' => \$opt_force,
467
'skip-master-binlog' => \$opt_skip_master_binlog,
468
'skip-slave-binlog' => \$opt_skip_slave_binlog,
469
467
'do-test=s' => \$opt_do_test,
470
468
'start-from=s' => \$opt_start_from,
471
469
'suite|suites=s' => \$opt_suites,
472
470
'skip-rpl' => \$opt_skip_rpl,
473
471
'skip-test=s' => \$opt_skip_test,
474
'big-test' => \$opt_big_test,
475
472
'combination=s' => \@opt_combinations,
476
473
'skip-combination' => \$opt_skip_combination,
488
485
# Extra options used when starting mysqld
489
486
'mysqld=s' => \@opt_extra_mysqld_opt,
487
'engine=s' => \$opt_engine,
491
489
# Run test on running server
492
490
'extern' => \$opt_extern,
542
540
'tmpdir=s' => \$opt_tmpdir,
543
541
'vardir=s' => \$opt_vardir,
542
'testdir=s' => \$opt_testdir,
544
543
'benchdir=s' => \$glob_mysql_bench_dir,
545
544
'mem' => \$opt_mem,
562
561
'testcase-timeout=i' => \$opt_testcase_timeout,
563
562
'suite-timeout=i' => \$opt_suite_timeout,
564
563
'warnings|log-warnings' => \$opt_warnings,
564
'repeat-test=i' => \$opt_repeat_test,
566
566
# Options which are no longer used
567
567
(map { $_ => \&warn_about_removed_option } @removed_options),
582
582
$opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
585
# We require that we are in the "mysql-test" directory
586
# to run drizzle-test-run
587
if (! -f $glob_scriptname)
589
mtr_error("Can't find the location for the drizzle-test-run script\n" .
590
"Go to to the mysql-test directory and execute the script " .
591
"as follows:\n./$glob_scriptname");
594
585
if ( -d "../drizzled" )
599
590
# Find the absolute path to the test directory
600
$glob_mysql_test_dir= cwd();
591
if ( ! $opt_testdir )
593
$glob_mysql_test_dir= cwd();
597
$glob_mysql_test_dir= $opt_testdir;
601
599
$default_vardir= "$glob_mysql_test_dir/var";
603
601
# In most cases, the base directory we find everything relative to,
615
613
$glob_basedir= dirname($glob_basedir);
616
if ( $opt_testdir and -d $opt_testdir and $opt_vardir and -d $opt_vardir
617
and -f "$opt_vardir/../../drizzled/drizzled")
619
# probably in a VPATH build
620
$glob_builddir= "$opt_vardir/../..";
618
627
# Expect mysql-bench to be located adjacent to the source tree, by default
619
628
$glob_mysql_bench_dir= "$glob_basedir/../mysql-bench"
620
629
unless defined $glob_mysql_bench_dir;
634
643
# Look for the client binaries directory
635
$path_client_bindir= mtr_path_exists("$glob_basedir/client",
644
$path_client_bindir= mtr_path_exists("$glob_builddir/client",
645
"$glob_basedir/client",
636
646
"$glob_basedir/bin");
638
# Look for charsetsdir, use same share
639
$path_share= mtr_path_exists("$glob_basedir/share/mysql",
640
"$glob_basedir/drizzled/share",
641
"$glob_basedir/share");
643
$path_charsetsdir= mtr_path_exists("$path_share/charsets");
647
648
if (!$opt_extern)
649
650
$exe_drizzled= mtr_exe_exists ("$glob_basedir/drizzled/drizzled",
650
651
"$path_client_bindir/drizzled",
651
652
"$glob_basedir/libexec/drizzled",
652
653
"$glob_basedir/bin/drizzled",
653
"$glob_basedir/sbin/drizzled");
654
"$glob_basedir/sbin/drizzled",
655
"$glob_builddir/drizzled/drizzled");
655
657
# Use the mysqld found above to find out what features are available
656
658
collect_mysqld_features();
693
700
# --------------------------------------------------------------------------
694
# Find out type of logging that are being used
695
# --------------------------------------------------------------------------
696
if (!$opt_extern && $mysql_version_id >= 50100 )
698
foreach my $arg ( @opt_extra_mysqld_opt )
700
if ( $arg =~ /binlog[-_]format=(\S+)/ )
702
$used_binlog_format= $1;
705
if (defined $used_binlog_format)
707
mtr_report("Using binlog format '$used_binlog_format'");
711
mtr_report("Using dynamic switching of binlog format");
716
# --------------------------------------------------------------------------
717
701
# Find out default storage engine being used(if any)
718
702
# --------------------------------------------------------------------------
719
703
foreach my $arg ( @opt_extra_mysqld_opt )
761
745
$opt_vardir= $default_vardir;
763
elsif ( $mysql_version_id < 50000 and
764
$opt_vardir ne $default_vardir)
766
# Version 4.1 and --vardir was specified
767
# Only supported as a symlink from var/
768
# by setting up $opt_mem that symlink will be created
770
# Only platforms that have native symlinks can use the vardir trick
771
$opt_mem= $opt_vardir;
772
mtr_report("Using 4.1 vardir trick");
775
$opt_vardir= $default_vardir;
778
748
$path_vardir_trace= $opt_vardir;
779
749
# Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
780
750
$path_vardir_trace=~ s/^\w://;
782
# We make the path absolute, as the server will do a chdir() before usage
783
unless ( $opt_vardir =~ m,^/,)
785
# Make absolute path, relative test dir
786
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
752
$opt_vardir= collapse_path($opt_vardir);
789
754
# --------------------------------------------------------------------------
816
781
# --------------------------------------------------------------------------
818
# --------------------------------------------------------------------------
824
# --------------------------------------------------------------------------
826
783
# --------------------------------------------------------------------------
827
784
if ( $opt_gcov and ! $source_dist )
1069
1026
print "got ".$mtr_build_thread."\n";
1029
$mtr_build_thread= (($mtr_build_thread * 10) % 2000) - 1000;
1072
1031
# Up to two masters, up to three slaves
1073
1032
# A magic value in command_line_setup depends on these equations.
1074
$opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
1033
$opt_master_myport= $mtr_build_thread + 9000; # and 1
1075
1034
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
1077
1036
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1187
1146
mtr_init_args(\$args);
1189
1148
mtr_add_arg($args, "--no-defaults");
1149
mtr_add_arg($args, "--skip-stack-trace");
1190
1150
mtr_add_arg($args, "--user=%s", $opt_user);
1191
1151
mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
1192
1152
mtr_add_arg($args, "--silent"); # Tab separated output
1234
1194
$exe_my_print_defaults=
1235
1195
mtr_exe_exists(
1236
1196
"$path_client_bindir/my_print_defaults",
1237
"$glob_basedir/extra/my_print_defaults");
1197
"$glob_basedir/extra/my_print_defaults",
1198
"$glob_builddir/extra/my_print_defaults");
1239
1200
# Look for perror
1240
1201
$exe_perror= "perror";
1243
1204
$exe_drizzlecheck= mtr_exe_exists("$path_client_bindir/drizzlecheck");
1244
1205
$exe_drizzledump= mtr_exe_exists("$path_client_bindir/drizzledump");
1245
1206
$exe_drizzleimport= mtr_exe_exists("$path_client_bindir/drizzleimport");
1246
$exe_drizzlebinlog= mtr_exe_exists("$path_client_bindir/drizzlebinlog");
1247
$exe_drizzleadmin= mtr_exe_exists("$path_client_bindir/drizzleadmin");
1248
1207
$exe_drizzle= mtr_exe_exists("$path_client_bindir/drizzle");
1250
1209
if (!$opt_extern)
1252
1211
# Look for SQL scripts directory
1253
if ( $mysql_version_id >= 50100 )
1255
$exe_mysqlslap= mtr_exe_exists("$path_client_bindir/mysqlslap");
1212
if ( $mysql_version_id >= 50100 )
1214
$exe_drizzleslap= mtr_exe_exists("$path_client_bindir/drizzleslap");
1259
1218
# Look for drizzletest executable
1340
1299
# --------------------------------------------------------------------------
1341
1300
if ( $source_dist )
1343
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
1344
"$glob_basedir/libmysql_r/.libs/",
1345
"$glob_basedir/zlib.libs/");
1302
push(@ld_library_paths, "$glob_basedir/libdrizzleclient/.libs/",
1303
"$glob_basedir/mysys/.libs/",
1304
"$glob_basedir/mystrings/.libs/",
1305
"$glob_basedir/drizzled/.libs/",
1369
1330
push(@ld_library_paths, $debug_libraries_path);
1372
$ENV{'LD_LIBRARY_PATH'}= join(":", @ld_library_paths,
1333
$ENV{'LD_LIBRARY_PATH'}= join(":",
1373
1334
$ENV{'LD_LIBRARY_PATH'} ?
1374
split(':', $ENV{'LD_LIBRARY_PATH'}) : ());
1335
split(':', $ENV{'LD_LIBRARY_PATH'}) : (),
1375
1337
mtr_debug("LD_LIBRARY_PATH: $ENV{'LD_LIBRARY_PATH'}");
1377
1339
$ENV{'DYLD_LIBRARY_PATH'}= join(":", @ld_library_paths,
1395
1357
# Also command lines in .opt files may contain env vars
1396
1358
# --------------------------------------------------------------------------
1398
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
1360
$ENV{'CHARSETSDIR'}= "";
1399
1361
$ENV{'UMASK'}= "0660"; # The octal *string*
1400
1362
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*
1413
1375
$ENV{'LC_COLLATE'}= "C";
1414
1376
$ENV{'USE_RUNNING_SERVER'}= $opt_extern;
1415
$ENV{'DRIZZLE_TEST_DIR'}= $glob_mysql_test_dir;
1377
$ENV{'DRIZZLE_TEST_DIR'}= collapse_path($glob_mysql_test_dir);
1416
1378
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
1417
1379
$ENV{'DRIZZLE_TMP_DIR'}= $opt_tmpdir;
1418
1380
$ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_sock'};
1425
1387
$ENV{'SLAVE_MYPORT2'}= $slave->[2]->{'port'};
1426
1388
$ENV{'DRIZZLE_TCP_PORT'}= $mysqld_variables{'port'};
1428
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
1390
$ENV{'MTR_BUILD_THREAD'}= $opt_mtr_build_thread;
1430
1392
$ENV{'EXE_MYSQL'}= $exe_drizzle;
1460
1422
$ENV{'DRIZZLE_DUMP'}= $cmdline_mysqldump;
1461
1423
$ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
1464
1425
# ----------------------------------------------------
1465
1426
# Setup env so childs can execute mysqlslap
1466
1427
# ----------------------------------------------------
1467
if ( $exe_mysqlslap )
1428
if ( $exe_drizzleslap )
1469
my $cmdline_mysqlslap=
1470
mtr_native_path($exe_mysqlslap) .
1430
my $cmdline_drizzleslap=
1431
mtr_native_path($exe_drizzleslap) .
1472
1433
"--port=$master->[0]->{'port'} ";
1474
1435
if ( $opt_debug )
1476
$cmdline_mysqlslap .=
1477
" --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
1437
$cmdline_drizzleslap .=
1438
" --debug=d:t:A,$path_vardir_trace/log/drizzleslap.trace";
1479
$ENV{'DRIZZLE_SLAP'}= $cmdline_mysqlslap;
1440
$ENV{'DRIZZLE_SLAP'}= $cmdline_drizzleslap;
1482
1445
# ----------------------------------------------------
1483
1446
# Setup env so childs can execute mysqlimport
1484
1447
# ----------------------------------------------------
1498
1461
# ----------------------------------------------------
1499
# Setup env so childs can execute mysqlbinlog
1500
# ----------------------------------------------------
1501
my $cmdline_mysqlbinlog=
1502
mtr_native_path($exe_drizzlebinlog) .
1503
" --no-defaults --disable-force-if-open --debug-check";
1504
if ( !$opt_extern && $mysql_version_id >= 50000 )
1506
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
1511
$cmdline_mysqlbinlog .=
1512
" --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
1514
$ENV{'DRIZZLE_BINLOG'}= $cmdline_mysqlbinlog;
1516
# ----------------------------------------------------
1517
1462
# Setup env so childs can execute mysql
1518
1463
# ----------------------------------------------------
1519
1464
my $cmdline_mysql=
1520
1465
mtr_native_path($exe_drizzle) .
1521
1466
" --no-defaults --debug-check --host=localhost --user=root --password= " .
1522
"--port=$master->[0]->{'port'} " .
1523
"--character-sets-dir=$path_charsetsdir";
1467
"--port=$master->[0]->{'port'} ";
1525
1469
$ENV{'MYSQL'}= $cmdline_mysql;
1556
1500
$ENV{'DRIZZLE_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults);
1558
1502
# ----------------------------------------------------
1559
# Setup env so childs can execute mysqladmin
1503
# Setup env so childs can shutdown the server
1560
1504
# ----------------------------------------------------
1561
$ENV{'MYSQLADMIN'}= mtr_native_path($exe_drizzleadmin);
1505
$ENV{'DRIZZLED_SHUTDOWN'}= mtr_native_path($exe_drizzle);
1563
1507
# ----------------------------------------------------
1564
1508
# Setup env so childs can execute perror
1791
1735
# Make a link std_data_ln in var/ that points to std_data
1792
symlink("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln");
1736
symlink(collapse_path("$glob_mysql_test_dir/std_data"),
1737
"$opt_vardir/std_data_ln");
1794
1739
# Remove old log files
1795
1740
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
1744
system("chmod -R ugo+r $opt_vardir");
1745
system("chmod -R ugo+r $opt_vardir/std_data_ln/*");
1887
1834
if ( ! $benchmark )
1889
mtr_add_arg($args, "--log");
1890
1836
mtr_run("$glob_mysql_bench_dir/run-all-tests", $args, "", "", "", "");
1891
1837
# FIXME check result code?!
1928
1874
foreach my $tinfo ( @$tests )
1930
if (run_testcase_check_skip_test($tinfo))
1876
foreach(1..$opt_repeat_test)
1878
if (run_testcase_check_skip_test($tinfo))
1883
mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
1884
run_testcase($tinfo);
1885
mtr_timer_stop($glob_timers,"testcase");
1935
mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
1936
run_testcase($tinfo);
1937
mtr_timer_stop($glob_timers,"testcase");
1940
1889
mtr_print_line();
2092
2041
unlink("$base_file.log");
2093
2042
unlink("$base_file.warnings");
2097
if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 )
2099
# Dynamically switch binlog format of
2100
# master, slave is always restarted
2101
foreach my $server ( @$master )
2103
next unless ($server->{'pid'});
2105
mtr_init_args(\$args);
2106
mtr_add_arg($args, "--no-defaults");
2107
mtr_add_arg($args, "--user=root");
2108
mtr_add_arg($args, "--port=$server->{'port'}");
2110
my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql";
2111
mtr_verbose("Setting binlog format:", $tinfo->{binlog_format});
2112
if (mtr_run($exe_drizzle, $args, $sql, "", "", "") != 0)
2114
mtr_error("Failed to switch binlog format");
2121
2046
sub do_after_run_drizzletest($)
2489
2414
mtr_add_arg($args, "%s--no-defaults", $prefix);
2416
$path_my_basedir= collapse_path($path_my_basedir);
2491
2417
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
2492
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
2421
mtr_add_arg($args, "%s--default-storage-engine=%s", $prefix, $opt_engine);
2494
2424
if ( $mysql_version_id >= 50036)
2497
2427
mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir);
2500
if ( $mysql_version_id >= 50000 )
2502
mtr_add_arg($args, "%s--log-bin-trust-function-creators", $prefix);
2505
mtr_add_arg($args, "%s--default-character-set=latin1", $prefix);
2506
2430
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
2508
2432
# Increase default connect_timeout to avoid intermittent
2527
2451
mtr_add_arg($args, "%s--datadir=%s", $prefix,
2528
2452
$mysqld->{'path_myddir'});
2530
my $log_base_path= "$opt_vardir/log/$mysqld->{'type'}$sidx";
2531
mtr_add_arg($args, "%s--log=%s.log", $prefix, $log_base_path);
2533
"%s--log-slow-queries=%s-slow.log", $prefix, $log_base_path);
2535
2454
# Check if "extra_opt" contains --skip-log-bin
2536
my $skip_binlog= grep(/^--skip-log-bin/, @$extra_opt, @opt_extra_mysqld_opt);
2537
2455
if ( $mysqld->{'type'} eq 'master' )
2539
if (! ($opt_skip_master_binlog || $skip_binlog) )
2541
mtr_add_arg($args, "%s--log-bin=%s/log/master-bin%s", $prefix,
2542
$opt_vardir, $sidx);
2545
2457
mtr_add_arg($args, "%s--server-id=%d", $prefix,
2546
2458
$idx > 0 ? $idx + 101 : 1);
2548
2460
mtr_add_arg($args, "%s--loose-innodb_data_file_path=ibdata1:10M:autoextend",
2551
mtr_add_arg($args, "%s--local-infile", $prefix);
2463
mtr_add_arg($args, "%s--loose-innodb-lock-wait-timeout=5", $prefix);
2553
2465
if ( $idx > 0 or !$use_innodb)
2560
2472
mtr_error("unknown mysqld type")
2561
2473
unless $mysqld->{'type'} eq 'slave';
2563
#mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
2564
if (! ( $opt_skip_slave_binlog || $skip_binlog ))
2566
mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
2567
$opt_vardir, $sidx); # FIXME use own dir for binlogs
2568
mtr_add_arg($args, "%s--log-slave-updates", $prefix);
2571
mtr_add_arg($args, "%s--master-retry-count=10", $prefix);
2573
mtr_add_arg($args, "%s--relay-log=%s/log/slave%s-relay-bin", $prefix,
2574
$opt_vardir, $sidx);
2575
mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix);
2576
mtr_add_arg($args, "%s--report-port=%d", $prefix,
2578
# mtr_add_arg($args, "%s--report-user=root", $prefix);
2579
mtr_add_arg($args, "%s--loose-skip-innodb", $prefix);
2580
mtr_add_arg($args, "%s--skip-slave-start", $prefix);
2582
2475
# Directory where slaves find the dumps generated by "load data"
2583
2476
# on the server. The path need to have constant length otherwise
2584
2477
# test results will vary, thus a relative path is used.
2585
2478
my $slave_load_path= "../tmp";
2586
mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix,
2588
mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix);
2590
2480
if ( @$slave_master_info )
2599
2489
my $slave_server_id= 2 + $idx;
2600
2490
my $slave_rpl_rank= $slave_server_id;
2601
2491
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
2602
# mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
2633
2522
$found_skip_core= 1;
2635
elsif ($skip_binlog and mtr_match_prefix($arg, "--binlog-format"))
2637
; # Dont add --binlog-format when running without binlog
2641
2526
mtr_add_arg($args, "%s%s", $prefix, $arg);
2646
2531
mtr_add_arg($args, "%s%s", $prefix, "--core-file");
2651
#mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
2652
#mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
2654
elsif ( $mysqld->{'type'} eq 'master' )
2656
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
2936
2811
if ( $mysqld->{'pid'} )
2938
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
2940
$admin_pids{$pid}= 1;
2943
pid => $mysqld->{'pid'},
2944
real_pid => $mysqld->{'real_pid'},
2945
pidfile => $mysqld->{'path_pid'},
2946
sockfile => $mysqld->{'path_sock'},
2947
port => $mysqld->{'port'},
2948
errfile => $mysqld->{'path_myerr'},
2951
$mysqld->{'pid'}= 0; # Assume we are done with it
2813
$pid= mtr_server_shutdown($mysqld);
2815
$admin_pids{$pid}= 1;
2818
pid => $mysqld->{'pid'},
2819
real_pid => $mysqld->{'real_pid'},
2820
pidfile => $mysqld->{'path_pid'},
2821
sockfile => $mysqld->{'path_sock'},
2822
port => $mysqld->{'port'},
2823
errfile => $mysqld->{'path_myerr'},
2826
$mysqld->{'pid'}= 0; # Assume we are done with it
2964
2839
if ( $mysqld->{'pid'} )
2966
$pid= mtr_mysqladmin_start($mysqld, "shutdown", 20);
2968
$admin_pids{$pid}= 1;
2971
pid => $mysqld->{'pid'},
2972
real_pid => $mysqld->{'real_pid'},
2973
pidfile => $mysqld->{'path_pid'},
2974
sockfile => $mysqld->{'path_sock'},
2975
port => $mysqld->{'port'},
2976
errfile => $mysqld->{'path_myerr'},
2980
$mysqld->{'pid'}= 0; # Assume we are done with it
2841
$pid= mtr_server_shutdown($mysqld);
2843
$admin_pids{$pid}= 1;
2846
pid => $mysqld->{'pid'},
2847
real_pid => $mysqld->{'real_pid'},
2848
pidfile => $mysqld->{'path_pid'},
2849
sockfile => $mysqld->{'path_sock'},
2850
port => $mysqld->{'port'},
2851
errfile => $mysqld->{'path_myerr'},
2854
$mysqld->{'pid'}= 0; # Assume we are done with it
3087
2961
mtr_add_arg($args, "--no-defaults");
3088
2962
mtr_add_arg($args, "--silent");
3089
2963
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
3090
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
3092
2965
mtr_add_arg($args, "--port=%d", $mysqld->{'port'});
3093
2966
mtr_add_arg($args, "--database=test");
3102
2975
mtr_add_arg($args, "--record");
2980
mtr_add_arg($args, "--testdir=%s", $opt_testdir);
3105
2983
my $res = mtr_run_test($exe_drizzletest,$args,
3106
2984
"include/check-testcase.test", "", "", "");
3166
3044
mtr_add_arg($args, "--no-defaults");
3167
3045
mtr_add_arg($args, "--silent");
3168
3046
mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
3169
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
3170
3047
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
3172
3049
# Log line number and time for each line in .test file
3209
3086
$path_vardir_trace);
3091
mtr_add_arg($args, "--testdir=%s", $opt_testdir);
3212
3095
# ----------------------------------------------------------------------
3213
3096
# export DRIZZLE_TEST variable containing <path>/drizzletest <args>
3214
3097
# ----------------------------------------------------------------------
3397
sub collapse_path ($) {
3399
my $c_path= rel2abs(shift);
3400
my $updir = updir($c_path);
3401
my $curdir = curdir($c_path);
3403
my($vol, $dirs, $file) = splitpath($c_path);
3404
my @dirs = splitdir($dirs);
3407
foreach my $dir (@dirs) {
3408
if( $dir eq $updir and # if we have an updir
3409
@collapsed and # and something to collapse
3410
length $collapsed[-1] and # and its not the rootdir
3411
$collapsed[-1] ne $updir and # nor another updir
3412
$collapsed[-1] ne $curdir # nor the curdir
3415
pop @collapsed; # collapse
3418
push @collapsed, $dir; # just hang onto it
3422
return catpath($vol, catdir(@collapsed), $file);
3515
3425
##############################################################################
3565
3475
list of suite names.
3566
3476
The default is: "$opt_suites_default"
3567
3477
skip-rpl Skip the replication test cases.
3568
big-test Set the environment variable BIG_TEST, which can be
3569
checked from test cases.
3570
3478
combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one
3572
3480
skip-combination Skip any combination options and combinations files
3481
repeat-test=n How many times to repeat each test (default: 1)
3574
3483
Options that specify ports