Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
de2bbb30
Commit
de2bbb30
authored
Jan 20, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-5.0
parents
2113675c
7885d70b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
88 deletions
+192
-88
mysql-test/lib/mtr_io.pl
mysql-test/lib/mtr_io.pl
+61
-2
mysql-test/lib/mtr_process.pl
mysql-test/lib/mtr_process.pl
+59
-20
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+72
-66
No files found.
mysql-test/lib/mtr_io.pl
View file @
de2bbb30
...
...
@@ -35,13 +35,72 @@ sub mtr_get_opts_from_file ($) {
while
(
<
FILE
>
)
{
chomp
;
s/\$MYSQL_TEST_DIR/$::glob_mysql_test_dir/g
;
push
(
@args
,
split
('
',
$_
));
# --set-variable=init_connect=set @a='a\\0c'
s/^\s+//
;
# Remove leading space
s/\s+$//
;
# Remove ending space
# This is strange, but we need to fill whitespace inside
# quotes with something, to remove later. We do this to
# be able to split on space. Else, we have trouble with
# options like
#
# --someopt="--insideopt1 --insideopt2"
#
# But still with this, we are not 100% sure it is right,
# we need a shell to do it right.
# print STDERR "\n";
# print STDERR "AAA: $_\n";
s/\'([^\'\"]*)\'/unspace($1,"\x0a")/g
e
;
s/\"([^\'\"]*)\"/unspace($1,"\x0b")/g
e
;
s/\'([^\'\"]*)\'/unspace($1,"\x0a")/g
e
;
s/\"([^\'\"]*)\"/unspace($1,"\x0b")/g
e
;
# print STDERR "BBB: $_\n";
# foreach my $arg (/(--?\w.*?)(?=\s+--?\w|$)/)
# FIXME ENV vars should be expanded!!!!
foreach
my
$arg
(
split
(
/[ \t]+/
))
{
$arg
=~
tr/\x11\x0a\x0b/ \'\"/
;
# Put back real chars
# The outermost quotes has to go
$arg
=~
s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/
or
$arg
=~
s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/
;
$arg
=~
s/\\\\/\\/g
;
$arg
=~
s/\$\{(\w+)\}/envsubst($1)/g
e
;
$arg
=~
s/\$(\w+)/envsubst($1)/g
e
;
# print STDERR "ARG: $arg\n";
push
(
@args
,
$arg
);
}
}
close
FILE
;
return
\
@args
;
}
sub
envsubst
{
my
$string
=
shift
;
if
(
!
defined
$ENV
{
$string
}
)
{
mtr_error
("
opt file referense
\
$
$string
that is unknown
");
}
return
$ENV
{
$string
};
}
sub
unspace
{
my
$string
=
shift
;
my
$quote
=
shift
;
$string
=~
s/[ \t]/\x11/g
;
return
"
$quote$string$quote
";
}
sub
mtr_fromfile
($)
{
my
$file
=
shift
;
...
...
mysql-test/lib/mtr_process.pl
View file @
de2bbb30
...
...
@@ -4,7 +4,7 @@
# and is part of the translation of the Bourne shell script with the
# same name.
use
Carp
qw(cluck)
;
#
use Carp qw(cluck);
use
strict
;
use
POSIX
"
:sys_wait_h
";
...
...
@@ -64,18 +64,6 @@ sub spawn_impl ($$$$$$$) {
my
$error
=
shift
;
my
$pid_file
=
shift
;
# FIXME
# FIXME really needing a PATH???
# $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}";
$ENV
{'
TZ
'}
=
"
GMT-3
";
# for UNIX_TIMESTAMP tests to work
$ENV
{'
LC_COLLATE
'}
=
"
C
";
$ENV
{'
MYSQL_TEST_DIR
'}
=
$::glob_mysql_test_dir
;
$ENV
{'
MASTER_MYPORT
'}
=
$::opt_master_myport
;
$ENV
{'
SLAVE_MYPORT
'}
=
$::opt_slave_myport
;
# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME
$ENV
{'
MYSQL_TCP_PORT
'}
=
3306
;
$ENV
{'
MASTER_MYSOCK
'}
=
$::master
->
[
0
]
->
{'
path_mysock
'};
if
(
$::opt_script_debug
)
{
print
STDERR
"
\n
";
...
...
@@ -85,17 +73,21 @@ sub spawn_impl ($$$$$$$) {
print
STDERR
"
####
",
"
STDERR
$error
\n
"
if
$error
;
if
(
$join
)
{
print
STDERR
"
####
",
"
run
";
print
STDERR
"
####
",
"
RUN
";
}
else
{
print
STDERR
"
####
",
"
spawn
";
print
STDERR
"
####
",
"
SPAWN
";
}
print
STDERR
"
$path
",
join
("
",
@$arg_list_t
),
"
\n
";
print
STDERR
"
####
",
"
-
"
x
78
,
"
\n
";
}
my
$pid
=
fork
();
if
(
!
defined
$pid
)
{
mtr_error
("
$path
(
$pid
) can't be forked
");
}
if
(
$pid
)
{
...
...
@@ -104,17 +96,22 @@ sub spawn_impl ($$$$$$$) {
{
# We run a command and wait for the result
# FIXME this need to be improved
waitpid
(
$pid
,
0
);
my
$res
=
waitpid
(
$pid
,
0
);
if
(
$res
==
-
1
)
{
mtr_error
("
$path
(
$pid
) got lost somehow
");
}
my
$exit_value
=
$?
>>
8
;
my
$signal_num
=
$?
&
127
;
my
$dumped_core
=
$?
&
128
;
if
(
$signal_num
)
{
mtr_error
("
spawn
got signal
$signal_num
");
mtr_error
("
$path
(
$pid
)
got signal
$signal_num
");
}
if
(
$dumped_core
)
{
mtr_error
("
spawn
dumped core
");
mtr_error
("
$path
(
$pid
)
dumped core
");
}
return
$exit_value
;
}
...
...
@@ -326,7 +323,8 @@ sub mtr_stop_mysqld_servers ($$) {
mtr_init_args
(
\
$args
);
mtr_add_arg
(
$args
,
"
--no-defaults
");
mtr_add_arg
(
$args
,
"
-uroot
");
mtr_add_arg
(
$args
,
"
--user=%s
",
$::opt_user
);
mtr_add_arg
(
$args
,
"
--password=
");
if
(
-
e
$srv
->
{'
sockfile
'}
)
{
mtr_add_arg
(
$args
,
"
--socket=%s
",
$srv
->
{'
sockfile
'});
...
...
@@ -336,7 +334,8 @@ sub mtr_stop_mysqld_servers ($$) {
mtr_add_arg
(
$args
,
"
--port=%s
",
$srv
->
{'
port
'});
}
mtr_add_arg
(
$args
,
"
--connect_timeout=5
");
mtr_add_arg
(
$args
,
"
--shutdown_timeout=70
");
mtr_add_arg
(
$args
,
"
--shutdown_timeout=20
");
mtr_add_arg
(
$args
,
"
--protocol=tcp
");
# FIXME new thing, will it help?!
mtr_add_arg
(
$args
,
"
shutdown
");
# We don't wait for termination of mysqladmin
mtr_spawn
(
$::exe_mysqladmin
,
$args
,
...
...
@@ -361,6 +360,10 @@ sub mtr_stop_mysqld_servers ($$) {
{
last
PIDSOCKFILEREMOVED
;
}
if
(
$loop
%
20
==
1
)
{
mtr_warning
("
Still processes alive after 10 seconds, retrying for
$loop
seconds...
");
}
mtr_debug
("
Sleep for 1 second waiting for pid and socket file removal
");
sleep
(
1
);
# One second
}
...
...
@@ -464,4 +467,40 @@ sub stop_reap_all {
$SIG
{
CHLD
}
=
'
DEFAULT
';
}
##############################################################################
#
# Wait for a file to be created
#
##############################################################################
sub
sleep_until_file_created
($$)
{
my
$pidfile
=
shift
;
my
$timeout
=
shift
;
my
$loop
=
$timeout
;
while
(
$loop
--
)
{
if
(
-
r
$pidfile
)
{
return
;
}
mtr_debug
("
Sleep for 1 second waiting for creation of
$pidfile
");
if
(
$loop
%
20
==
1
)
{
mtr_warning
("
Waiting for
$pidfile
to be created, still trying for
$loop
seconds...
");
}
sleep
(
1
);
}
if
(
!
-
r
$pidfile
)
{
mtr_error
("
No
$pidfile
was created
");
}
}
1
;
mysql-test/mysql-test-run.pl
View file @
de2bbb30
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment