~drizzle-trunk/drizzle/development

0.67.305 by Bernt M. Johnsen
Copyright headres and license added
1
# Copyright (C) 2008-2010 Sun Microsystems, Inc. All rights reserved.
2
# Use is subject to license terms.
3
#
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 2 of the License.
7
#
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
# General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
16
# USA
17
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
18
use lib 'lib';
19
use lib "$ENV{RQG_HOME}/lib";
0.67.69 by John H. Embretsen
pb2gentest.pl: Temporarily add randgen/lib as 'use' library until PB2 config can be fixed.
20
use lib 'randgen/lib';
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
21
0.67.1 by Philip Stoev
initial import from internal tree
22
use strict;
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
23
use Carp;
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
24
use Cwd;
25
use DBI;
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
26
use File::Find;
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
27
use GenTest::Random;
0.67.1 by Philip Stoev
initial import from internal tree
28
use POSIX;
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
29
use Sys::Hostname;
0.67.1 by Philip Stoev
initial import from internal tree
30
31
my ($basedir, $vardir, $tree, $test) = @ARGV;
32
33
#
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
34
# For further details about tests and recommended RQG options, see
35
# http://forge.mysql.com/wiki/RandomQueryGeneratorTests
36
#
37
0.67.78 by John H. Embretsen
pb2gentest.pl: Disable pb2 db lookup of branch id (while working out perl module issues on certain platforms). Get from env var instead, if set. Adjust messages accordingly
38
print("==================== Starting $0 ====================\n");
0.67.124 by John H. Embretsen
pb2gentest: Simple MTR-style reporting of test results, for xref and PB2 (pass/fail only, no signature support yet).
39
# Print MTR-style output saying which test suite/mode this is for PB2 reporting.
40
# So far we only support running one test at a time.
41
print("##############################################################################\n");
42
print("# $test\n");
43
print("##############################################################################\n");
0.67.78 by John H. Embretsen
pb2gentest.pl: Disable pb2 db lookup of branch id (while working out perl module issues on certain platforms). Get from env var instead, if set. Adjust messages accordingly
44
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
45
# Autoflush output buffers (needed when using POSIX::_exit())
46
$| = 1;
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
47
48
#
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
49
# Check OS. Windows and Unix/Linux are too different.
0.67.1 by Philip Stoev
initial import from internal tree
50
#
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
51
my $windowsOS;
0.67.1 by Philip Stoev
initial import from internal tree
52
if (
53
	($^O eq 'MSWin32') ||
54
	($^O eq 'MSWin64')
55
) {
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
56
	$windowsOS = 'true';
57
}
58
59
#
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
60
# Prepare ENV variables and other settings.
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
61
#
62
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
63
# Local "installation" of MySQL 5.0. Default is for Unix hosts. See below for Windows.
64
my $basedirRelease50 = '/export/home/mysql-releases/mysql-5.0';
65
0.67.120 by John H. Embretsen
pb2gentest: Prepare for splitting of RQG framework and grammars by making grammar and gendata file location configurable.
66
# Location of grammars and other test configuration files.
0.67.136 by John H. Embretsen
Minor fixes to comments in pb2{gentest,combinations}.pl
67
# Will use env variable RQG_CONF if set.
0.67.120 by John H. Embretsen
pb2gentest: Prepare for splitting of RQG framework and grammars by making grammar and gendata file location configurable.
68
# Default is currently "conf" while using legacy setup.
69
# If not absolute path, it is relative to cwd at run time, which is the randgen directory.
70
my $conf = $ENV{RQG_CONF};
71
$conf = 'conf' if not defined $conf;
72
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
73
if ($windowsOS) {
0.67.1 by Philip Stoev
initial import from internal tree
74
	# For tail and for cdb
0.67.16 by John H. Embretsen
Update paths in PB2 scripts, having modified PB2 host setup to use the randgen branch on Launchpad.
75
	$ENV{PATH} = 'G:\pb2\scripts\randgen\bin;G:\pb2\scripts\bin;C:\Program Files\Debugging Tools for Windows (x86);'.$ENV{PATH};
0.67.1 by Philip Stoev
initial import from internal tree
76
	$ENV{_NT_SYMBOL_PATH} = 'srv*c:\\cdb_symbols*http://msdl.microsoft.com/download/symbols;cache*c:\\cdb_symbols';
77
78
	# For vlad
79
	#ENV{MYSQL_FULL_MINIDUMP} = 1;
80
0.67.213 by John H. Embretsen
pb2gentest: Stop printining date and time twice. Also skip uname (some host information is printed later).
81
	#system("date /T");
82
	#system("time /T");
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
83
84
	# Path to MySQL releases used for comparison runs.
85
	$basedirRelease50 = 'G:\mysql-releases\mysql-5.0.87-win32'; # loki06
0.67.1 by Philip Stoev
initial import from internal tree
86
} elsif ($^O eq 'solaris') {
87
	# For libmysqlclient
88
	$ENV{LD_LIBRARY_PATH}=$ENV{LD_LIBRARY_PATH}.':/export/home/pb2/scripts/lib/';
89
90
	# For DBI and DBD::mysql
91
	$ENV{PERL5LIB}=$ENV{PERL5LIB}.':/export/home/pb2/scripts/DBI-1.607/:/export/home/pb2/scripts/DBI-1.607/lib:/export/home/pb2/scripts/DBI-1.607/blib/arch/:/export/home/pb2/scripts/DBD-mysql-4.008/lib/:/export/home/pb2/scripts/DBD-mysql-4.008/blib/arch/';
92
	
93
	# For c++filt
94
	$ENV{PATH} = $ENV{PATH}.':/opt/studio12/SUNWspro/bin';
95
0.67.213 by John H. Embretsen
pb2gentest: Stop printining date and time twice. Also skip uname (some host information is printed later).
96
	#system("uname -a");
97
	#system("date");
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
98
0.67.1 by Philip Stoev
initial import from internal tree
99
}
100
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
101
################################################################################
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
102
##
103
## subroutines
104
##
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
105
################################################################################
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
106
107
#
0.67.79 by John H. Embretsen
pb2gentest: Enable rpl_semisync test on Windows, as support for this was recently added to replication development branches.
108
# Skips the test, displays reason (argument to the routine) quasi-MTR-style and
109
# exits with exit code 0.
110
#
111
# Example usage:
112
#   # This feature is not yet supported on Windows, so skip this test
113
#   skip_test("This feature/test does not support the Windows platform at this time");
114
#
115
# will appear in output as:
116
#   rpl_semisync                             [ skipped ] This feature/test does not support the Windows platform at this time
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
117
#
118
sub skip_test {
119
	my $reason = @_[0];
120
	my $message = "$test";
121
	# Using MTR-style output for the readers' convenience.
122
	# (at least 41 chars before "[ skipped ]")
123
	while (length $message < 40)
124
	{
125
		$message = $message.' ';
126
	}
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
127
	$message = $message." [ skipped ] ".$reason;
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
128
	print "$message\n";
129
	print localtime()." [$$] $0 will exit with exit status 0.\n";
130
	POSIX::_exit (0);
131
}
132
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
133
#
134
# Returns a random number between 1 and 499.
135
#
136
sub pick_random_port_range_id {
137
	my $prng = GenTest::Random->new( seed => time );
138
	return $prng->uint16(1,499);
139
}
140
141
#
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
142
# Searches recursively for a given file name under the given directory.
143
# Default top search directory is $basedir.
144
#
145
# Arg1 (mandatory): file name (excluding path)
146
# Arg2 (optional) : directory where search will start
147
#
148
# Returns full path to the directory where the file resides, if found.
149
# If more than one matching file is found, the directory of the first one found
150
# in a depth-first search will be returned.
151
# Returns undef if none is found.
152
#
153
sub findDirectory {
154
	my ($plugin_name, $dir) = @_;
155
	if (not defined $plugin_name) {
156
		carp("File name required as argument to subroutine findDirectory()");
157
	}
158
	if (not defined $dir) {
159
		$dir = $basedir;
160
	}
161
	my $fullPath;	# the result
162
	find(sub {
163
			# This subroutine is called for each file and dir it finds.
164
			# According to docs it does depth-first search.
165
			if ($_ eq $plugin_name) {
166
				$fullPath = $File::Find::dir if not defined $fullPath;
167
			}
168
			# any return value is ignored
169
		}, $dir);
170
	return $fullPath;
171
}
172
173
#
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
174
# Get the bzr branch ID from the pushbuild2 database (internal), based on the
175
# branch name ($tree variable).
176
#
177
# If the branch name (tree) is not found in the database, or we are unable to
178
# connect to the database, undef is returned.
179
#
180
sub get_pb2_branch_id {
181
0.67.78 by John H. Embretsen
pb2gentest.pl: Disable pb2 db lookup of branch id (while working out perl module issues on certain platforms). Get from env var instead, if set. Adjust messages accordingly
182
	# First, check if the environment variable BRANCH_ID is set.
183
	if (defined $ENV{BRANCH_ID}) {
184
		return $ENV{BRANCH_ID};
185
	} else {
186
		# Disable db lookup for the time being due to issues on sparc32.
187
		# Remove this "else" block to enable
188
		return;
189
	}
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
190
	# Lookup by branch name. Get branch name from tree, which could be url.
191
	my $branch_name = $tree;
192
	if ($tree =~ m{/}) {
193
		# Found '/', assuming tree is URL.
194
		# Find last substring that is between a '/' and either end-of-string or a '/' followed by end of string.
195
		$tree =~ m{.*/([^/]+)($|/$)};
196
		$branch_name=$1;
197
	}
198
199
	my $dsn_pb2 = 'dbi:mysql:host=trollheim.norway.sun.com:port=3306:user=readonly:database=pushbuild2';
200
	my $SQL_getBranchId = "SELECT branch_id FROM branches WHERE branch_name = '$branch_name'";
201
202
	print("Using branch name $branch_name\n");
203
	print("Trying to connect to pushbuild2 database...\n");
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
204
205
	my $dbh = DBI->connect($dsn_pb2, undef, undef, {
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
206
		mysql_connect_timeout => 5,
207
		PrintError => 0,
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
208
		RaiseError => 0,
209
		AutoCommit => 0,
210
	} );
211
212
	if (not defined $dbh) {
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
213
		print("connect() to pushbuild2 database failed: ".$DBI::errstr."\n");
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
214
		return;
215
	}
216
217
	my $id = $dbh->selectrow_array($SQL_getBranchId);
218
	$dbh->disconnect;
219
	return $id;
220
}
221
222
#### end subroutines ###########################################################
223
0.67.16 by John H. Embretsen
Update paths in PB2 scripts, having modified PB2 host setup to use the randgen branch on Launchpad.
224
chdir('randgen');
0.67.1 by Philip Stoev
initial import from internal tree
225
0.67.211 by John H. Embretsen
pb2gentest: Change '*' output prefixes to '=' (or '+' for the Shutdown wait-for-pid output) so we don't confuse people with red coloring in PB2 logs.
226
print("===== Information on the host system: =====\n");
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
227
print(" - Local time  : ".localtime()."\n");
228
print(" - Hostname    : ".hostname()."\n");
229
print(" - PID         : $$\n");
230
print(" - Working dir : ".cwd()."\n");
0.85.1 by John H. Embretsen
pb2gentest: Display PATH, to be better able to debug environmental issues in PB2.
231
print(" - PATH        : ".$ENV{'PATH'}."\n");
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
232
print(" - Script arguments:\n");
233
print("       basedir = $basedir\n");
234
print("       vardir  = $vardir\n");
235
print("       tree    = $tree\n");
236
print("       test    = $test\n");
237
print("\n");
0.67.211 by John H. Embretsen
pb2gentest: Change '*' output prefixes to '=' (or '+' for the Shutdown wait-for-pid output) so we don't confuse people with red coloring in PB2 logs.
238
print("===== Information on Random Query Generator version (bzr): =====\n");
0.67.68 by John H. Embretsen
pb2gentest.pl: Re-enabled printing of bzr branch/version information on startup. Using 'bzr info' instead of 'bzr parent' because parent is a plugin command that is not available on all PB2 hosts.
239
system("bzr info");
240
system("bzr version-info");
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
241
print("\n");
0.67.1 by Philip Stoev
initial import from internal tree
242
0.67.116 by John H. Embretsen
pb2gentest: Support "rqg_" prefix in test names. If it is there, strip it off before processing further.
243
# Test name:
244
#   In PB2, tests run via this script are prefixed with "rqg_" so that it is
245
#   easy to distinguish these tests from other "external" tests.
246
#   For a while we will support test names both with and without the prefix.
247
#   For this reason we strip off the "rqg_" prefix before continuing.
248
#   This also means that you cannot try to match against "rqg_" prefix in test
249
#   "definitions" (if statements) below.
0.67.124 by John H. Embretsen
pb2gentest: Simple MTR-style reporting of test results, for xref and PB2 (pass/fail only, no signature support yet).
250
my $test_name = $test;
251
my $test_suite_name = 'serverqa'; # used for xref reporting
252
$test =~ s/^rqg_//;	# test_name without prefix
0.67.116 by John H. Embretsen
pb2gentest: Support "rqg_" prefix in test names. If it is there, strip it off before processing further.
253
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
254
# Server port numbers:
255
#
0.67.212 by John H. Embretsen
pb2gentest: No longer set MTR_BUILD_THREAD unless specified by user. Our PB2 hosts should run Cat most 1 test at a time.
256
# If several instances of this script may run at the same time on the same
257
# host, port number conflicts may occur.
258
#
259
# If needed, use use a port range ID (integer) that is unique for this host at
260
# this time.
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
261
# This ID is used by the RQG framework to designate a port range to use for the
262
# test run. Passed to RQG using the MTR_BUILD_THREAD environment variable
263
# (this naming is a legacy from MTR, which is used by RQG to start the MySQL
264
# server).
265
#
266
# Solution: Use unique port range id per branch. Use "branch_id" as recorded
267
#           in PB2 database (guaranteed unique per branch).
268
# Potential issue 1: Unable to connect to pb2 database.
269
# Solution 1: Pick a random ID between 1 and some sensible number (e.g. 500).
270
# Potential issue 2: Clashing resources when running multiple pushes in same branch?
271
# Potential solution 2: Keep track of used ids in local file(s). Pick unused id.
272
#                       (not implemented yet)
0.67.212 by John H. Embretsen
pb2gentest: No longer set MTR_BUILD_THREAD unless specified by user. Our PB2 hosts should run Cat most 1 test at a time.
273
#
274
# Currently (December 2009) PB2 RQG host should be running only one test at a
275
# time, so this should not be an issue, hence no need to set MTR_BUILD_THREAD.
276
277
#print("===== Determining port base id: =====\n");
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
278
my $port_range_id; # Corresponding to MTR_BUILD_THREAD in the MySQL MTR world.
0.67.212 by John H. Embretsen
pb2gentest: No longer set MTR_BUILD_THREAD unless specified by user. Our PB2 hosts should run Cat most 1 test at a time.
279
# First, see if user has supplied us with a value for MTR_BUILD_THREAD:
0.67.83 by John H. Embretsen
pb2gentest: Do not pick a port base ID if MTR_BUILD_THREAD is already set by user. This allows the user to control which ports will be used.
280
$port_range_id = $ENV{MTR_BUILD_THREAD};
281
if (defined $port_range_id) {
282
	print("Environment variable MTR_BUILD_THREAD was already set.\n");
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
283
}
0.67.212 by John H. Embretsen
pb2gentest: No longer set MTR_BUILD_THREAD unless specified by user. Our PB2 hosts should run Cat most 1 test at a time.
284
#else {
285
#	# try to obtain branch id, somehow
286
#	$port_range_id = get_pb2_branch_id();
287
#	if (not defined $port_range_id) {
288
#		print("Unable to get branch id. Picking a 'random' port base id...\n");
289
#		$port_range_id = pick_random_port_range_id();
290
#	} else {
291
#		print("Using pb2 branch ID as port base ID.\n");
292
#	}
293
#}
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
294
295
print("Configuring test...\n");
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
296
0.67.1 by Philip Stoev
initial import from internal tree
297
my $cwd = cwd();
298
299
my $command;
300
my $engine;
301
my $rpl_mode;
302
303
if (($engine) = $test =~ m{(maria|falcon|innodb|myisam|pbxt)}io) {
304
	print "Detected that this test is about the $engine engine.\n";
305
}
306
307
if (($rpl_mode) = $test =~ m{(rbr|sbr|mbr|statement|mixed|row)}io) {
308
	print "Detected that this test is about replication mode $rpl_mode.\n";
309
	$rpl_mode = 'mixed' if $rpl_mode eq 'mbr';
310
	$rpl_mode = 'statement' if $rpl_mode eq 'sbr';
311
	$rpl_mode = 'row' if $rpl_mode eq 'rbr';
312
}
313
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
314
#
315
# Start defining tests. Test name can be whatever matches the regex in the if().
316
# TODO: Define less ambiguous test names to avoid accidental misconfiguration.
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
317
#
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
318
# Starting out with "legacy" Falcon tests.
319
#
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
320
if ($test =~ m{falcon_.*transactions}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
321
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
322
		--grammar='.$conf.'/transactions/transactions.yy
323
		--gendata='.$conf.'/transactions/transactions.zz
0.67.1 by Philip Stoev
initial import from internal tree
324
		--mysqld=--falcon-consistent-read=1
325
		--mysqld=--transaction-isolation=REPEATABLE-READ
326
		--validator=DatabaseConsistency
327
		--mem
328
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
329
} elsif ($test =~ m{falcon_.*durability}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
330
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
331
		--grammar='.$conf.'/transactions/transaction_durability.yy
0.67.1 by Philip Stoev
initial import from internal tree
332
		--vardir1='.$vardir.'/vardir-'.$engine.'
333
		--vardir2='.$vardir.'/vardir-innodb
334
		--mysqld=--default-storage-engine='.$engine.'
335
		--mysqld=--falcon-checkpoint-schedule=\'1 1 1 1 1\'
336
		--mysqld2=--default-storage-engine=Innodb
337
		--validator=ResultsetComparator
338
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
339
} elsif ($test =~ m{falcon_repeatable_read}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
340
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
341
		--grammar='.$conf.'/transactions/repeatable_read.yy
342
		--gendata='.$conf.'/transactions/transactions.zz
0.67.1 by Philip Stoev
initial import from internal tree
343
		--mysqld=--falcon-consistent-read=1
344
		--mysqld=--transaction-isolation=REPEATABLE-READ
345
		--validator=RepeatableRead
346
		--mysqld=--falcon-consistent-read=1
347
		--mem
348
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
349
} elsif ($test =~ m{falcon_chill_thaw_compare}io) {
0.67.1 by Philip Stoev
initial import from internal tree
350
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
351
	        --grammar='.$conf.'/engines/falcon/falcon_chill_thaw.yy
352
		--gendata='.$conf.'/engines/falcon/falcon_chill_thaw.zz
0.67.1 by Philip Stoev
initial import from internal tree
353
	        --mysqld=--falcon-record-chill-threshold=1K
354
	        --mysqld=--falcon-index-chill-threshold=1K 
355
		--threads=1
356
		--vardir1='.$vardir.'/chillthaw-vardir
357
		--vardir2='.$vardir.'/default-vardir
358
		--reporters=Deadlock,ErrorLog,Backtrace
359
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
360
} elsif ($test =~ m{falcon_chill_thaw}io) {
0.67.1 by Philip Stoev
initial import from internal tree
361
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
362
	        --grammar='.$conf.'/engines/falcon/falcon_chill_thaw.yy
0.67.1 by Philip Stoev
initial import from internal tree
363
	        --mysqld=--falcon-index-chill-threshold=4K 
364
	        --mysqld=--falcon-record-chill-threshold=4K
365
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
366
} elsif ($test =~ m{falcon_online_alter}io) {
0.67.1 by Philip Stoev
initial import from internal tree
367
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
368
	        --grammar='.$conf.'/engines/falcon/falcon_online_alter.yy
0.67.1 by Philip Stoev
initial import from internal tree
369
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
370
} elsif ($test =~ m{falcon_ddl}io) {
0.67.1 by Philip Stoev
initial import from internal tree
371
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
372
	        --grammar='.$conf.'/engines/falcon/falcon_ddl.yy
0.67.1 by Philip Stoev
initial import from internal tree
373
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
374
} elsif ($test =~ m{falcon_limit_compare_self}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
375
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
376
		--grammar='.$conf.'/engines/falcon/falcon_nolimit.yy
0.67.1 by Philip Stoev
initial import from internal tree
377
		--threads=1
378
		--validator=Limit
379
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
380
} elsif ($test =~ m{falcon_limit_compare_innodb}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
381
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
382
		--grammar='.$conf.'/engines/falcon/limit_compare.yy
0.67.1 by Philip Stoev
initial import from internal tree
383
		--vardir1='.$vardir.'/vardir-falcon
384
		--vardir2='.$vardir.'/vardir-innodb
385
		--mysqld=--default-storage-engine=Falcon
386
		--mysqld2=--default-storage-engine=Innodb
387
		--threads=1
388
		--reporters=
389
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
390
} elsif ($test =~ m{falcon_limit}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
391
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
392
	        --grammar='.$conf.'/engines/falcon/falcon_limit.yy
0.67.1 by Philip Stoev
initial import from internal tree
393
		--mysqld=--loose-maria-pagecache-buffer-size=64M
394
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
395
} elsif ($test =~ m{falcon_recovery}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
396
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
397
	        --grammar='.$conf.'/engines/falcon/falcon_recovery.yy
398
		--gendata='.$conf.'/engines/falcon/falcon_recovery.zz
0.67.1 by Philip Stoev
initial import from internal tree
399
		--mysqld=--falcon-checkpoint-schedule="1 1 1 1 1"
400
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
401
} elsif ($test =~ m{falcon_pagesize_32K}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
402
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
403
		--grammar='.$conf.'/engines/falcon/falcon_pagesize.yy
0.67.1 by Philip Stoev
initial import from internal tree
404
		--mysqld=--falcon-page-size=32K
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
405
		--gendata='.$conf.'/engines/falcon/falcon_pagesize32K.zz
0.67.1 by Philip Stoev
initial import from internal tree
406
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
407
} elsif ($test =~ m{falcon_pagesize_2K}io) {
0.67.1 by Philip Stoev
initial import from internal tree
408
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
409
		--grammar='.$conf.'/engines/falcon/falcon_pagesize.yy
0.67.1 by Philip Stoev
initial import from internal tree
410
		--mysqld=--falcon-page-size=2K
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
411
		--gendata='.$conf.'/engines/falcon/falcon_pagesize2K.zz
0.67.1 by Philip Stoev
initial import from internal tree
412
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
413
} elsif ($test =~ m{falcon_select_autocommit}io) {
0.67.1 by Philip Stoev
initial import from internal tree
414
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
415
		--grammar='.$conf.'/engines/falcon/falcon_select_autocommit.yy
0.67.1 by Philip Stoev
initial import from internal tree
416
		--queries=10000000
417
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
418
} elsif ($test =~ m{falcon_backlog}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
419
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
420
		--grammar='.$conf.'/engines/falcon/falcon_backlog.yy
421
		--gendata='.$conf.'/engines/falcon/falcon_backlog.zz
0.67.1 by Philip Stoev
initial import from internal tree
422
		--mysqld=--transaction-isolation=REPEATABLE-READ
423
		--mysqld=--falcon-record-memory-max=10M
424
		--mysqld=--falcon-record-chill-threshold=1K
425
		--mysqld=--falcon-page-cache-size=128M
426
	';
427
} elsif ($test =~ m{falcon_compare_innodb}io ) {
428
        # Datatypes YEAR and TIME disabled in grammars due to Bug#45499 (InnoDB). 
429
        # Revert to falcon_data_types.{yy|zz} when that bug is resolved in relevant branches.
430
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
431
		--grammar='.$conf.'/engines/falcon/falcon_data_types_no_year_time.yy
432
		--gendata='.$conf.'/engines/falcon/falcon_data_types_no_year_time.zz
0.67.1 by Philip Stoev
initial import from internal tree
433
		--vardir1='.$vardir.'/vardir-falcon
434
		--vardir2='.$vardir.'/vardir-innodb
435
		--mysqld=--default-storage-engine=Falcon
436
		--mysqld2=--default-storage-engine=Innodb
437
		--threads=1
438
		--reporters=
439
	';
0.67.290 by John H. Embretsen
pb2gentest: Disable compare_self testing against InnoDB, MyISAM, as this test makes most sense to run against more unstable, 'broken' storage engines.
440
} elsif ($test =~ m{falcon_compare_self}io ) {
0.67.238 by John H. Embretsen
pb2gentest: Enable 'compare_self' (datatypes) test also for other engines (myisam, innodb) than falcon.
441
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
442
		--grammar='.$conf.'/engines/falcon/falcon_data_types.yy
443
		--gendata='.$conf.'/engines/falcon/falcon_data_types.zz
0.67.238 by John H. Embretsen
pb2gentest: Enable 'compare_self' (datatypes) test also for other engines (myisam, innodb) than falcon.
444
		--vardir1='.$vardir.'/'.$engine.'-vardir1
445
		--vardir2='.$vardir.'/'.$engine.'-vardir2
446
		--threads=1
447
		--reporters=
448
	';
0.67.290 by John H. Embretsen
pb2gentest: Disable compare_self testing against InnoDB, MyISAM, as this test makes most sense to run against more unstable, 'broken' storage engines.
449
#
450
# END OF FALCON-ONLY TESTS
451
#
0.67.236 by John H. Embretsen
pb2gentest: Add configuration for innodb_repeatable_read test (based on existing falcon equivalent).
452
} elsif ($test =~ m{innodb_repeatable_read}io ) {
453
	# Transactional test. See also falcon_repeatable_read.
454
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
455
		--grammar='.$conf.'/transactions/repeatable_read.yy
456
		--gendata='.$conf.'/transactions/transactions.zz
0.67.236 by John H. Embretsen
pb2gentest: Add configuration for innodb_repeatable_read test (based on existing falcon equivalent).
457
		--mysqld=--transaction-isolation=REPEATABLE-READ
458
		--validator=RepeatableRead
459
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
460
} elsif ($test =~ m{(falcon|myisam)_blob_recovery}io ) {
461
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
462
		--grammar='.$conf.'/engines/falcon/falcon_blobs.yy
463
		--gendata='.$conf.'/engines/falcon/falcon_blobs.zz
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
464
		--duration=130
465
		--threads=1
0.67.88 by John H. Embretsen
pb2gentest: Use Recovery reporter in myisam_blob_recovery test (this was a regression caused by a previous change).
466
		--reporters=Deadlock,ErrorLog,Backtrace,Recovery,Shutdown
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
467
	';
468
	if ($test =~ m{falcon}io) {
469
		# this option works with Falcon-enabled builds only
470
		$command = $command.'
471
			--mysqld=--falcon-page-cache-size=128M
472
		';
473
	}
0.67.227 by John H. Embretsen
many_indexes: Temporarily disable use of UTF16 until WL#1213 is pushed to non-falcon branches. Add support for innodb and myisam engines in pb2gentest.
474
} elsif ($test =~ m{(falcon|innodb|myisam)_many_indexes}io ) {
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
475
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
476
		--grammar='.$conf.'/engines/many_indexes.yy
477
		--gendata='.$conf.'/engines/many_indexes.zz
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
478
	';
0.67.224 by John H. Embretsen
pb2gentest: Explicitly add support for innodb and myisam engines for test using falcon_tiny_inserts grammar.
479
} elsif ($test =~ m{(falcon|innodb|myisam)_tiny_inserts}io) {
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
480
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
481
		--gendata='.$conf.'/engines/tiny_inserts.zz
482
		--grammar='.$conf.'/engines/tiny_inserts.yy
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
483
		--queries=10000000
484
	';
0.67.231 by John H. Embretsen
pb2gentest: Definition for rqg_innodb_transactions test.
485
} elsif ($test =~ m{innodb_transactions}io) {
486
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
487
		--grammar='.$conf.'/transactions/transactions.yy
488
		--gendata='.$conf.'/transactions/transactions.zz
0.67.231 by John H. Embretsen
pb2gentest: Definition for rqg_innodb_transactions test.
489
		--mysqld=--transaction-isolation=REPEATABLE-READ
490
		--validator=DatabaseConsistency
491
	';
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
492
#
0.67.224 by John H. Embretsen
pb2gentest: Explicitly add support for innodb and myisam engines for test using falcon_tiny_inserts grammar.
493
# END OF STORAGE ENGINE TESTS
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
494
#
495
# Keep the following tests in alphabetical order (based on letters in regex)
496
# for easy lookup.
497
#
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
498
} elsif ($test =~ m{^backup_.*?_simple}io) {
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
499
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
500
		--grammar='.$conf.'/backup/backup_simple.yy
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
501
		--reporters=Deadlock,ErrorLog,Backtrace
0.67.145 by John H. Embretsen
pb2gentest: Make sure backup feature is enabled for backup tests (add --mysql-bakcup option). Also add --innodb option to server command line if backup test is for InnoDB.
502
		--mysqld=--mysql-backup
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
503
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
504
} elsif ($test =~ m{^backup_.*?_consistency}io) {
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
505
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
506
		--gendata='.$conf.'/backup/invariant.zz
507
		--grammar='.$conf.'/backup/invariant.yy
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
508
		--validator=Invariant
509
		--reporters=Deadlock,ErrorLog,Backtrace,BackupAndRestoreInvariant,Shutdown
0.67.145 by John H. Embretsen
pb2gentest: Make sure backup feature is enabled for backup tests (add --mysql-bakcup option). Also add --innodb option to server command line if backup test is for InnoDB.
510
		--mysqld=--mysql-backup
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
511
		--duration=600
512
		--threads=25
513
	';
514
} elsif ($test =~ m{dml_alter}io ) {
515
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
516
		--gendata='.$conf.'/engines/maria/maria.zz
517
		--grammar='.$conf.'/engines/maria/maria_dml_alter.yy
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
518
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
519
} elsif ($test =~ m{^info_schema}io ) {
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
520
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
521
		--grammar='.$conf.'/runtime/information_schema.yy
0.72.1 by John H. Embretsen
pb2gentest: info_schema test should use 10 threads, not 100 (100 is overkill).
522
		--threads=10
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
523
		--duration=300
0.67.148 by Philip Stoev
better INFORMATION_SCHEMA test
524
		--mysqld=--log-output=file
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
525
	';
0.83.2 by John H. Embretsen
pb2gentest: Add mdl_stability test config.
526
} elsif ($test =~ m{^mdl_stability}io ) {
527
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
528
		--grammar='.$conf.'/runtime/metadata_stability.yy
529
		--gendata='.$conf.'/runtime/metadata_stability.zz
0.83.2 by John H. Embretsen
pb2gentest: Add mdl_stability test config.
530
		--validator=SelectStability,QueryProperties
531
		--engine=Innodb
532
		--mysqld=--innodb
533
		--mysqld=--default-storage-engine=Innodb
534
		--mysqld=--transaction-isolation=SERIALIZABLE
535
		--mysqld=--innodb-flush-log-at-trx-commit=2
0.67.322 by John H. Embretsen
pb2gentest: Add --loose- to --table-lock-wait-timeout option, removed in MySQL 5.5
536
		--mysqld=--loose-table-lock-wait-timeout=1
0.83.2 by John H. Embretsen
pb2gentest: Add mdl_stability test config.
537
		--mysqld=--innodb-lock-wait-timeout=1
538
		--mysqld=--log-output=file
539
		--queries=1M
540
		--duration=600
541
	';
0.99.5 by John H. Embretsen
pb2gentest: Add mdl_deadlock test, using higher lock wait timeouts than other MDL tests in order to detect more potential deadlocks. The downside is that this test may also detect more false deadlocks (valid lock waits).
542
} elsif ($test =~ m{^mdl_deadlock}io ) {
543
    #
544
    # Should be same as mdl_stress (or mdl_stability, whichever has produced
545
    # the most deadlocks), except with higher (~default) lock_wait_timeouts.
546
    # The other variants have very low wait timeouts, making it difficult to
547
    # detect invalid deadlocks.
548
    # As per Feb-26-2010 default innodb-lock-wait-timeout=50 and
549
    # table-lock-wait-timeout=31536000 (bug#45225).
550
    #
551
    $command = '
552
        --grammar=conf/runtime/WL5004_sql.yy
553
        --threads=10
554
        --queries=1M
555
        --duration=1800
556
        --mysqld=--innodb
557
        --mysqld=--innodb-lock-wait-timeout=50
558
        --mysqld=--loose-table-lock-wait-timeout=31536000
559
        --mysqld=--log-output=file
560
    ';
0.83.1 by John H. Embretsen
pb2gentest: Rename mdl test to mdl_stress.
561
} elsif ($test =~ m{^mdl_stress}io ) {
0.81.8 by John H. Embretsen
pb2gentest: Add test config for comprehensive metadata locking test (WL#5004)
562
	# Seems like --gendata=conf/WL5004_data.zz unexplicably causes more test
563
	# failures, so let's leave this out of PB2 for the time being (pstoev).
0.67.152 by John H. Embretsen
pb2gentest: Rename mdl_innodb to mdl and enable innodb explicitly, based on feedback from pstoev (test is not per se for innodb so having innodb in the test name may be confusing).
564
	#
565
	# InnoDB should be loaded but the test is not per se for InnoDB, hence
566
	# no "innodb" in test name.
0.81.8 by John H. Embretsen
pb2gentest: Add test config for comprehensive metadata locking test (WL#5004)
567
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
568
		--grammar=conf/runtime/WL5004_sql.yy
0.81.8 by John H. Embretsen
pb2gentest: Add test config for comprehensive metadata locking test (WL#5004)
569
		--threads=10
570
		--queries=1M
571
		--duration=1800
0.67.152 by John H. Embretsen
pb2gentest: Rename mdl_innodb to mdl and enable innodb explicitly, based on feedback from pstoev (test is not per se for innodb so having innodb in the test name may be confusing).
572
		--mysqld=--innodb
0.81.8 by John H. Embretsen
pb2gentest: Add test config for comprehensive metadata locking test (WL#5004)
573
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
574
} elsif ($test =~ m{^partition_ddl}io ) {
0.67.93 by John H. Embretsen
pb2gentest: Add configuration for 'partition_ddl' test.
575
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
576
		--grammar='.$conf.'/partitioning/partitions-ddl.yy
0.67.142 by John H. Embretsen
pb2gentest: Set option --mysqld=--innodb for tests that always use innodb.
577
		--mysqld=--innodb
0.67.93 by John H. Embretsen
pb2gentest: Add configuration for 'partition_ddl' test.
578
		--threads=1
579
		--queries=100K
580
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
581
} elsif ($test =~ m{partn_pruning(|.valgrind)$}io ) {
0.67.126 by John H. Embretsen
pb2gentest: partn_pruning: Reduce duration from default (600s) to 300s, since we also spend a lot of time creating tables.
582
	# reduced duration to half since gendata phase takes longer in this case
0.67.94 by John H. Embretsen
pb2gentest: Add first version of config for 'partition_pruning' test.
583
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
584
		--gendata='.$conf.'/partitioning/partition_pruning.zz
585
		--grammar='.$conf.'/partitioning/partition_pruning.yy
0.67.142 by John H. Embretsen
pb2gentest: Set option --mysqld=--innodb for tests that always use innodb.
586
		--mysqld=--innodb
0.67.94 by John H. Embretsen
pb2gentest: Add first version of config for 'partition_pruning' test.
587
		--threads=1
588
		--queries=100000
0.67.126 by John H. Embretsen
pb2gentest: partn_pruning: Reduce duration from default (600s) to 300s, since we also spend a lot of time creating tables.
589
		--duration=300
0.67.94 by John H. Embretsen
pb2gentest: Add first version of config for 'partition_pruning' test.
590
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
591
} elsif ($test =~ m{^partn_pruning_compare_50}io) {
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
592
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
593
	--gendata='.$conf.'/partitioning/partition_pruning.zz
594
	--grammar='.$conf.'/partitioning/partition_pruning.yy
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
595
	--basedir1='.$basedir.'
596
	--basedir2='.$basedirRelease50.'
597
	--vardir1='.$vardir.'/vardir-bzr
598
	--vardir2='.$vardir.'/vardir-5.0
0.67.142 by John H. Embretsen
pb2gentest: Set option --mysqld=--innodb for tests that always use innodb.
599
	--mysqld=--innodb
0.80.5 by John H. Embretsen
pb2gentest: Changes to partn_pruning_compare_50:
600
	--validators=ResultsetComparator
601
	--reporters=Deadlock,ErrorLog,Backtrace
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
602
	--threads=1
603
	--queries=10000
0.80.5 by John H. Embretsen
pb2gentest: Changes to partn_pruning_compare_50:
604
	--duration=300
0.67.114 by John H. Embretsen
pb2gentest: Add partn_pruning_compare_50 test definition, including setting path to installation of 5.0 release against which to do query result comparison. This is to be considered experimental for the time being.
605
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
606
} elsif ($test =~ m{^rpl_.*?_simple}io) {
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
607
	# Not used; rpl testing needs adjustments (some of the failures this
608
	# produces are known replication issues documented in the manual).
0.67.1 by Philip Stoev
initial import from internal tree
609
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
610
		--gendata='.$conf.'/replication/replication_single_engine.zz
611
		--grammar='.$conf.'/replication/replication_simple.yy
0.67.1 by Philip Stoev
initial import from internal tree
612
		--mysqld=--log-output=table,file
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
613
	';
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
614
} elsif ($test =~ m{^rpl_.*?_complex}io) {
615
	# Not used; rpl testing needs adjustments (some of the failures this
616
	# produces are known replication issues documented in the manual).
617
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
618
		--gendata='.$conf.'/replication/replication_single_engine_pk.zz
619
		--grammar='.$conf.'/replication/replication.yy
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
620
		--mysqld=--log-output=table,file
0.67.142 by John H. Embretsen
pb2gentest: Set option --mysqld=--innodb for tests that always use innodb.
621
		--mysqld=--innodb
0.67.84 by John H. Embretsen
pb2gentest: Made test configurations that support or are used for the Falcon engine only trigger only if falcon is mentioned in test name. Otherwise this may interfere with other tests for other features. This should make myisam_blob_recovery work (used to fail due to unknown falcon option being specified). Also moved multi-engine or engine independent tests closer together.
622
	';
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
623
} elsif ($test =~ m{^rpl_semisync}io) {
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
624
	# --rpl_mode=default is used because the .YY file changes the binary log format dynamically.
625
	# --threads=1 is used to avoid any replication failures due to concurrent DDL.
626
	# --validator= line will remove the default replication Validator, which would otherwise
627
	#   report test failure when the slave I/O thread is stopped, which is OK in the context
628
	#   of this particular test.
0.70.3 by John H. Embretsen
pb2gentest: Logic for making sure correct plugin file name is passed on to the RQG/MySQL on Windows (.dll vs .so) for rpl_semisync test.
629
0.67.79 by John H. Embretsen
pb2gentest: Enable rpl_semisync test on Windows, as support for this was recently added to replication development branches.
630
	# Plugin file names and location vary between platforms.
0.67.187 by John H. Embretsen
pb2gentest: Extra comment about semisync plugin location, in case we see issues with this in the future.
631
	# See http://bugs.mysql.com/bug.php?id=49170 for details.
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
632
	# We search for the respective file names under basedir (recursively).
633
	# The first matching file that is found is used.
634
	# We assume that both master and slave plugins are in the same dir.
0.67.187 by John H. Embretsen
pb2gentest: Extra comment about semisync plugin location, in case we see issues with this in the future.
635
	# Unix file name extenstions other than .so may exist, but support for this
636
	# is not yet implemented here.
0.67.79 by John H. Embretsen
pb2gentest: Enable rpl_semisync test on Windows, as support for this was recently added to replication development branches.
637
	my $plugin_dir;
0.70.3 by John H. Embretsen
pb2gentest: Logic for making sure correct plugin file name is passed on to the RQG/MySQL on Windows (.dll vs .so) for rpl_semisync test.
638
	my $plugins;
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
639
	if ($windowsOS) {
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
640
		my $master_plugin_name = "semisync_master.dll";
641
		$plugin_dir=findDirectory($master_plugin_name);
642
		if (not defined $plugin_dir) {
643
			carp "Unable to find semisync plugin $master_plugin_name!";
644
		}
645
		$plugins = 'rpl_semi_sync_master='.$master_plugin_name.';rpl_semi_sync_slave=semisync_slave.dll';
0.70.3 by John H. Embretsen
pb2gentest: Logic for making sure correct plugin file name is passed on to the RQG/MySQL on Windows (.dll vs .so) for rpl_semisync test.
646
	} else {
0.67.79 by John H. Embretsen
pb2gentest: Enable rpl_semisync test on Windows, as support for this was recently added to replication development branches.
647
		# tested on Linux and Solaris
0.89.1 by John H. Embretsen
Workaround for MySQL bug 48351: Support semisync plugin names both with and without 'lib'-prefix. With time only non-prefixed plugin name will be used. Also support other plugin dirs (release builds, sandbox builds etc) by doing recursive search for plugin files. First match wins.
648
		my $prefix;	# for Bug#48351
649
		my $master_plugin_name = "semisync_master.so";
650
		$plugin_dir=findDirectory($master_plugin_name);
651
		if (not defined $plugin_dir) {
652
			# Until fix for Bug#48351 is widespread it may happen
653
			# that the Unix plugin names are prefixed with "lib".
654
			# Remove this when no longer needed.
655
			$prefix = 'lib';
656
			$plugin_dir=findDirectory($prefix.$master_plugin_name);
657
			if (not defined $plugin_dir) {
658
				carp "Unable to find semisync plugin! ($master_plugin_name or $prefix$master_plugin_name)";
659
			}
660
		}
661
		$plugins = 'rpl_semi_sync_master='.$prefix.$master_plugin_name.':rpl_semi_sync_slave='.$prefix.'semisync_slave.so';
0.70.3 by John H. Embretsen
pb2gentest: Logic for making sure correct plugin file name is passed on to the RQG/MySQL on Windows (.dll vs .so) for rpl_semisync test.
662
	}
0.67.120 by John H. Embretsen
pb2gentest: Prepare for splitting of RQG framework and grammars by making grammar and gendata file location configurable.
663
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
664
		--gendata='.$conf.'/replication/replication_single_engine.zz
0.67.63 by Philip Stoev
fixes to pb2gentest.pl for semisynch replication
665
		--engine=InnoDB
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
666
		--grammar='.$conf.'/replication/replication_simple.yy
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
667
		--rpl_mode=default
0.67.120 by John H. Embretsen
pb2gentest: Prepare for splitting of RQG framework and grammars by making grammar and gendata file location configurable.
668
		--mysqld=--plugin-dir='.$plugin_dir.'
669
		--mysqld=--plugin-load='.$plugins.'
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
670
		--mysqld=--rpl_semi_sync_master_enabled=1
671
		--mysqld=--rpl_semi_sync_slave_enabled=1
0.81.1 by John H. Embretsen
pb2gentest: Generalize use of --innodb option. Add it if test name includes 'innodb'. Also continue adding it for special tests whose names do not incldue 'innodb'. innodb_limit test added for script testing purposes (for now).
672
		--mysqld=--innodb
0.67.63 by Philip Stoev
fixes to pb2gentest.pl for semisynch replication
673
		--reporters=ReplicationSemiSync,Deadlock,Backtrace,ErrorLog
0.67.186 by John H. Embretsen
pb2gentest: Specify 'None' validator when we do not want to use any validators. See bug#49167.
674
		--validators=None
0.70.2 by John H. Embretsen
Added new test rpl_semisync to pb2gentest.pl.
675
		--threads=1
676
		--duration=300
677
		--queries=1M
0.67.120 by John H. Embretsen
pb2gentest: Prepare for splitting of RQG framework and grammars by making grammar and gendata file location configurable.
678
	';
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
679
} elsif ($test =~ m{signal_resignal}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
680
	$command = '
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
681
		--threads=10
682
		--queries=1M
683
		--duration=300
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
684
		--grammar='.$conf.'/runtime/signal_resignal.yy
0.67.92 by John H. Embretsen
pb2gentest: Reorder (alphabetize) non-falcon test definitions for easier lookup.
685
		--mysqld=--max-sp-recursion-depth=10
0.67.1 by Philip Stoev
initial import from internal tree
686
	';
0.67.222 by John H. Embretsen
pb2gentest: Explicitly support innodb and myisam engines for test using maria_stress grammar.
687
} elsif ($test =~ m{(innodb|maria|myisam)_stress}io ) {
0.67.1 by Philip Stoev
initial import from internal tree
688
	$command = '
0.99.3 by John H. Embretsen
Categorized configuration files by moving them into subdirectories with descriptive names.
689
		--grammar='.$conf.'/engines/maria/maria_stress.yy
0.67.1 by Philip Stoev
initial import from internal tree
690
	';
0.67.85 by John H. Embretsen
pb2gentest: Exit with an error message if test name is not recognized by this script.
691
} else {
692
	print("[ERROR]: Test configuration for test name '$test' is not ".
693
		"defined in this script.\n");
694
	my $exitCode = 1;
695
	print("Will exit $0 with exit code $exitCode.\n");
696
	POSIX::_exit ($exitCode);
0.67.1 by Philip Stoev
initial import from internal tree
697
}
698
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
699
#
700
# Specify some "default" Reporters if none have been specified already.
701
# The RQG itself also specifies some default values for some options if not set.
702
#
0.67.1 by Philip Stoev
initial import from internal tree
703
if ($command =~ m{--reporters}io) {
704
	# Reporters have already been specified	
705
} elsif ($test =~ m{rpl}io ) {
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
706
	# Don't include Recovery for replication tests, because
707
	$command = $command.' --reporters=Deadlock,ErrorLog,Backtrace';
708
} elsif ($test =~ m{falcon}io ) {
709
	# Include the Recovery reporter for Falcon tests in order to test
710
	# recovery by default after each such test.
711
	$command = $command.' --reporters=Deadlock,ErrorLog,Backtrace,Recovery,Shutdown';
712
	# Falcon-only options (avoid "unknown variable" warnings in non-Falcon builds)
713
	$command = $command.' --mysqld=--loose-falcon-lock-wait-timeout=5 --mysqld=--loose-falcon-debug-mask=2';
0.67.1 by Philip Stoev
initial import from internal tree
714
} else {
0.71.1 by John H. Embretsen
Added new tests info_schema and signal_resignal to pb2gentest, and added basic "skip test" functionality.
715
	# Default reporters for tests whose name does not contain "rpl" or "falcon"
716
	$command = $command.' --reporters=Deadlock,ErrorLog,Backtrace,Shutdown';
0.67.1 by Philip Stoev
initial import from internal tree
717
}
718
0.81.1 by John H. Embretsen
pb2gentest: Generalize use of --innodb option. Add it if test name includes 'innodb'. Also continue adding it for special tests whose names do not incldue 'innodb'. innodb_limit test added for script testing purposes (for now).
719
#
720
# Other defaults...
721
#
722
0.67.1 by Philip Stoev
initial import from internal tree
723
if ($command !~ m{--duration}io ) {
0.67.103 by John H. Embretsen
pb2gentest: Set default duration of 10 minutes. 20 minutes is too long when the number of RQG tests in PB2 increases, causing delays.
724
	# Set default duration for tests where duration is not specified.
725
	# In PB2 we cannot run tests for too long since there are many branches
726
	# and many pushes (or other test triggers).
727
	# Setting it to 10 minutes for now.
728
	$command = $command.' --duration=600';
0.67.1 by Philip Stoev
initial import from internal tree
729
}
730
0.67.115 by John H. Embretsen
pb2gentest: Do not set default --basedir if some basedir is already set.
731
if ($command !~ m{--basedir}io ) {
732
	$command = $command." --basedir=\"$basedir\"";
733
}
734
0.67.1 by Philip Stoev
initial import from internal tree
735
if ($command !~ m{--vardir}io && $command !~ m{--mem}io ) {
736
	$command = $command." --vardir=\"$vardir\"";
737
}
738
739
if ($command !~ m{--log-output}io) {
740
	$command = $command.' --mysqld=--log-output=file';
741
}
742
0.67.330 by John H. Embretsen
pb2gentest: Decrease default lock-wait timeouts to 1s. Add new option --loose-lock-wait-timeout=1 by default.
743
# 1s to enable increased concurrency. NOTE: Removed in MySQL 5.5, Feb 2010.
0.67.323 by John H. Embretsen
pb2gentest: Make sure custom set values of lock timeouts are not overridden.
744
if ($command !~ m{table-lock-wait-timeout}io) {
0.67.330 by John H. Embretsen
pb2gentest: Decrease default lock-wait timeouts to 1s. Add new option --loose-lock-wait-timeout=1 by default.
745
    $command = $command.' --mysqld=--loose-table-lock-wait-timeout=1';
746
}
747
748
# 1s to enable increased concurrency. NOTE: Added in MySQL 5.5, Feb 2010 (bug#45225).
749
# Default value in the server is 1 year.
750
if ($command !~ m{(--|--loose-)lock-wait-timeout}io) {
751
    $command = $command.' --mysqld=--loose-lock-wait-timeout=1';
752
}
753
754
# Decrease from default (50s) to 1s to enable increased concurrency.
0.67.323 by John H. Embretsen
pb2gentest: Make sure custom set values of lock timeouts are not overridden.
755
if ($command !~ m{innodb-lock-wait-timeout}io) {
0.67.330 by John H. Embretsen
pb2gentest: Decrease default lock-wait timeouts to 1s. Add new option --loose-lock-wait-timeout=1 by default.
756
    $command = $command.' --mysqld=--loose-innodb-lock-wait-timeout=1';
0.67.323 by John H. Embretsen
pb2gentest: Make sure custom set values of lock timeouts are not overridden.
757
}
758
0.67.1 by Philip Stoev
initial import from internal tree
759
if ($command !~ m{--queries}io) {
760
	$command = $command.' --queries=100000';
761
}
762
763
if (($command !~ m{--(engine|default-storage-engine)}io) && (defined $engine)) {
764
	$command = $command." --engine=$engine";
765
}
766
0.82.1 by John H. Embretsen
pb2gentest: Add --engine=innodb for all named innodb tests.
767
# if test name contains "innodb", add the --mysqld=--innodb and --engine=innodb 
768
# options if they are not there already.
769
if ( ($test =~ m{innodb}io) ){
770
	if ($command !~ m{mysqld=--innodb}io){
771
		$command = $command.' --mysqld=--innodb';
772
	}
773
	if ($command !~ m{engine=innodb}io){
774
		$command = $command.' --engine=innodb';
775
	}
0.81.1 by John H. Embretsen
pb2gentest: Generalize use of --innodb option. Add it if test name includes 'innodb'. Also continue adding it for special tests whose names do not incldue 'innodb'. innodb_limit test added for script testing purposes (for now).
776
}
777
0.67.1 by Philip Stoev
initial import from internal tree
778
if (($command !~ m{--rpl_mode}io)  && ($rpl_mode ne '')) {
779
	$command = $command." --rpl_mode=$rpl_mode";
780
}
0.81.2 by John H. Embretsen
pb2gentest: Add --valgrind option to runall commands for tests which names include 'valgrind'.
781
782
# if test name contains (usually ends with) "valgrind", add the valgrind option to runall.pl
783
if ($test =~ m{valgrind}io){
784
	print("Detected that this test should enable valgrind instrumentation.\n");
785
	if (system("valgrind --version")) {
786
		print("  *** valgrind executable not found! Not setting --valgrind flag.\n");
787
	} else {
788
		$command = $command.' --valgrind';
789
	}
790
}
0.67.1 by Philip Stoev
initial import from internal tree
791
	
0.67.323 by John H. Embretsen
pb2gentest: Make sure custom set values of lock timeouts are not overridden.
792
$command = "perl runall.pl --mysqld=--loose-skip-safemalloc ".$command;
0.67.1 by Philip Stoev
initial import from internal tree
793
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
794
# Add env variable to specify unique port range to use to avoid conflicts.
0.67.212 by John H. Embretsen
pb2gentest: No longer set MTR_BUILD_THREAD unless specified by user. Our PB2 hosts should run Cat most 1 test at a time.
795
# Trying not to do this unless actually needed.
796
if (defined $port_range_id) {
797
	print("MTR_BUILD_THREAD=$port_range_id\n");
798
	if ($windowsOS) {
799
		$command = "set MTR_BUILD_THREAD=$port_range_id && ".$command;
800
	} else {
801
		$command = "MTR_BUILD_THREAD=$port_range_id ".$command;
802
	}
0.67.67 by John H. Embretsen
pb2gentest.pl: Fixed setting of MTR_BUILD_THREAD on Windows (multiple commands on single command line). Created convenience variable for checking if we are on Windows OS.
803
}
0.67.66 by John H. Embretsen
pb2gentest: Set MTR_BUILD_THREAD to avoid port number conflicts during parallel test runs on the same host.
804
0.67.1 by Philip Stoev
initial import from internal tree
805
$command =~ s{[\r\n\t]}{ }sgio;
0.67.74 by John H. Embretsen
pb2gentest.pl: Improved output/information when starting the script and adjusted pb2 database connection details.
806
print("Running runall.pl...\n");
0.67.1 by Philip Stoev
initial import from internal tree
807
my $command_result = system($command);
0.67.124 by John H. Embretsen
pb2gentest: Simple MTR-style reporting of test results, for xref and PB2 (pass/fail only, no signature support yet).
808
# shift result code to the right to obtain the code returned from the called script
809
my $command_result_shifted = ($command_result >> 8);
810
811
# Report test result in an MTR fashion so that PB2 will see it and add to
812
# xref database etc.
813
# Format: TESTSUITE.TESTCASE 'TESTMODE' [ RESULT ]
814
# Example: ndb.ndb_dd_alter 'InnoDB plugin'     [ fail ]
815
# Not using TESTMODE for now.
816
817
my $full_test_name = $test_suite_name.'.'.$test_name;
818
# keep test statuses more or less vertically aligned
819
while (length $full_test_name < 40)
820
{
821
	$full_test_name = $full_test_name.' ';
822
}
823
824
if ($command_result_shifted > 0) {
825
	# test failed
0.67.265 by John H. Embretsen
pb2gentest: Try-out code to mark failing tests as 'experimental' in a test branch in PB2.
826
	# Trying out marking a test as "experimental" by reporting exp-fail:
827
	# Mark all failures in next-mr-johnemb as experimental (temporary).
828
	if ($ENV{BRANCH_NAME} =~ m{mysql-next-mr-johnemb}) {
829
		print($full_test_name." [ exp-fail ]\n");
830
	} else {
831
		print($full_test_name." [ fail ]\n");
832
	}
0.67.124 by John H. Embretsen
pb2gentest: Simple MTR-style reporting of test results, for xref and PB2 (pass/fail only, no signature support yet).
833
	print('runall.pl failed with exit code '.$command_result_shifted."\n");
834
	print("Look above this message in the test log for failure details.\n");
835
} else {
836
	print($full_test_name." [ pass ]\n");
837
}
0.67.1 by Philip Stoev
initial import from internal tree
838
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
839
840
841
# Kill remaining mysqld processes.
842
# Assuming only one test run going on at the same time, and that all mysqld
843
# processes are ours.
844
print("Checking for remaining mysqld processes...\n");
845
if ($windowsOS) {
846
	# assumes MS Sysinternals PsTools is installed in C:\bin
0.67.136 by John H. Embretsen
Minor fixes to comments in pb2{gentest,combinations}.pl
847
	# If you need to run pslist or pskill as non-Admin user, some adjustments
848
	# may be needed. See:
849
	#   http://blogs.technet.com/markrussinovich/archive/2007/07/09/1449341.aspx
0.80.6 by John H. Embretsen
pb2gentest: Fix quoting and output redirection around pslist and pskill commands.
850
	if (system('C:\bin\pslist mysqld') == 0) {
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
851
		print(" ^--- Found running mysqld process(es), to be killed if possible.\n");
0.80.6 by John H. Embretsen
pb2gentest: Fix quoting and output redirection around pslist and pskill commands.
852
		system('C:\bin\pskill mysqld > '.$vardir.'/pskill_mysqld.out 2>&1');
853
		system('C:\bin\pskill mysqld-nt > '.$vardir.'/pskill_mysqld-nt.out 2>&1');
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
854
	} else { print("  None found.\n"); }
855
	
856
} else {
857
	# Unix/Linux.
858
	# Avoid "bad argument count" messages from kill by checking if process exists first.
0.67.125 by John H. Embretsen
pb2gentest: Get rid of spurious error messages at end of runs (from kill and killall) by:
859
	if (system("pgrep mysqld") == 0) {
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
860
		print(" ^--- Found running mysqld process(es), to be killed if possible.\n");
0.67.125 by John H. Embretsen
pb2gentest: Get rid of spurious error messages at end of runs (from kill and killall) by:
861
		system("pgrep mysqld | xargs kill -15"); # "soft" kill
862
		sleep(5);
863
		if (system("pgrep mysqld > /dev/null") == 0) {
864
			# process is still around...
865
			system("pgrep mysqld | xargs kill -9"); # "hard" kill
866
		}
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
867
	} else { print("  None found.\n"); }
0.67.1 by Philip Stoev
initial import from internal tree
868
}
869
0.80.4 by John H. Embretsen
pb2gentest: Kill remaining mysqld processes also on Windows (requires pskill from MS SysInternals PsTools).
870
print(" [$$] $0 will exit with exit status ".$command_result_shifted."\n");
0.67.124 by John H. Embretsen
pb2gentest: Simple MTR-style reporting of test results, for xref and PB2 (pass/fail only, no signature support yet).
871
POSIX::_exit ($command_result_shifted);