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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
97d46a0c
Commit
97d46a0c
authored
Mar 01, 2011
by
Michael Widenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revoked changes from MySQL 5.1.55 merge as Sergei's code is more general
parent
845afae6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
30 deletions
+17
-30
mysql-test/lib/My/ConfigFactory.pm
mysql-test/lib/My/ConfigFactory.pm
+17
-30
No files found.
mysql-test/lib/My/ConfigFactory.pm
View file @
97d46a0c
...
@@ -64,16 +64,12 @@ sub fix_pidfile {
...
@@ -64,16 +64,12 @@ sub fix_pidfile {
sub
fix_port
{
sub
fix_port
{
my
(
$self
,
$config
,
$group_name
,
$group
)
=
@_
;
my
(
$self
,
$config
,
$group_name
,
$group
)
=
@_
;
my
$hostname
=
$group
->
value
('
#host
');
return
$self
->
{
PORT
}
++
;
return
$self
->
{
HOSTS
}
->
{
$hostname
}
++
;
}
}
sub
fix_host
{
sub
fix_host
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
# Get next host from HOSTS array
'
localhost
'
my
@hosts
=
keys
(
%
{
$self
->
{
HOSTS
}});;
my
$host_no
=
$self
->
{
NEXT_HOST
}
++
%
@hosts
;
return
$hosts
[
$host_no
];
}
}
sub
is_unique
{
sub
is_unique
{
...
@@ -237,7 +233,7 @@ if (IS_WINDOWS)
...
@@ -237,7 +233,7 @@ if (IS_WINDOWS)
sub
fix_ndb_mgmd_port
{
sub
fix_ndb_mgmd_port
{
my
(
$self
,
$config
,
$group_name
,
$group
)
=
@_
;
my
(
$self
,
$config
,
$group_name
,
$group
)
=
@_
;
my
$hostname
=
$group
->
value
('
HostName
');
my
$hostname
=
$group
->
value
('
HostName
');
return
$self
->
{
HOSTS
}
->
{
$hostname
}
++
;
return
$self
->
{
PORT
}
++
;
}
}
...
@@ -436,20 +432,24 @@ sub post_check_embedded_group {
...
@@ -436,20 +432,24 @@ sub post_check_embedded_group {
sub
resolve_at_variable
{
sub
resolve_at_variable
{
my
(
$self
,
$config
,
$group
,
$option
)
=
@_
;
my
(
$self
,
$config
,
$group
,
$option
)
=
@_
;
local
$_
=
$option
->
value
();
my
(
$res
,
$after
);
# Split the options value on last .
while
(
m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g
)
{
my
@parts
=
split
(
/\./
,
$option
->
value
());
my
(
$before
,
$group_name
,
$option_name
)
=
(
$1
,
$2
,
$3
);
my
$option_name
=
pop
(
@parts
);
$after
=
$'
;
my
$group_name
=
join
('
.
',
@parts
);
chop
(
$group_name
);
$group_name
=~
s/^\@//
;
# Remove at
my
$from_group
=
$config
->
group
(
$group_name
)
my
$from_group
=
$config
->
group
(
$group_name
)
or
croak
"
There is no group named '
$group_name
' that
",
or
croak
"
There is no group named '
$group_name
' that
",
"
can be used to resolve '
$option_name
' for test '
$self
->{testname}'
";
"
can be used to resolve '
$option_name
' for test '
$self
->{testname}'
";
my
$from
=
$from_group
->
value
(
$option_name
);
my
$value
=
$from_group
->
value
(
$option_name
);
$config
->
insert
(
$group
->
name
(),
$option
->
name
(),
$from
)
$res
.=
$before
.
$value
;
}
$res
.=
$after
;
$config
->
insert
(
$group
->
name
(),
$option
->
name
(),
$res
)
}
}
...
@@ -461,7 +461,7 @@ sub post_fix_resolve_at_variables {
...
@@ -461,7 +461,7 @@ sub post_fix_resolve_at_variables {
next
unless
defined
$option
->
value
();
next
unless
defined
$option
->
value
();
$self
->
resolve_at_variable
(
$config
,
$group
,
$option
)
$self
->
resolve_at_variable
(
$config
,
$group
,
$option
)
if
(
$option
->
value
()
=~
/
^
\@/
);
if
(
$option
->
value
()
=~
/\@/
);
}
}
}
}
}
}
...
@@ -603,25 +603,12 @@ sub new_config {
...
@@ -603,25 +603,12 @@ sub new_config {
croak
"
you must pass '
$required
'
"
unless
defined
$args
->
{
$required
};
croak
"
you must pass '
$required
'
"
unless
defined
$args
->
{
$required
};
}
}
# Fill in hosts/port hash
my
$hosts
=
{};
my
$baseport
=
$args
->
{
baseport
};
$args
->
{
hosts
}
=
[
'
localhost
'
]
unless
exists
(
$args
->
{
hosts
});
foreach
my
$host
(
@
{
$args
->
{
hosts
}}
)
{
$hosts
->
{
$host
}
=
$baseport
;
}
# Open the config template
# Open the config template
my
$config
=
My::
Config
->
new
(
$args
->
{'
template_path
'});
my
$config
=
My::
Config
->
new
(
$args
->
{'
template_path
'});
my
$extra_template_path
=
$args
->
{'
extra_template_path
'};
if
(
$extra_template_path
){
$config
->
append
(
My::
Config
->
new
(
$extra_template_path
));
}
my
$self
=
bless
{
my
$self
=
bless
{
CONFIG
=>
$config
,
CONFIG
=>
$config
,
ARGS
=>
$args
,
ARGS
=>
$args
,
HOSTS
=>
$hosts
,
PORT
=>
$args
->
{
baseport
},
NEXT_HOST
=>
0
,
SERVER_ID
=>
1
,
SERVER_ID
=>
1
,
testname
=>
$args
->
{
testname
},
testname
=>
$args
->
{
testname
},
},
$class
;
},
$class
;
...
...
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