Commit 4fef6443 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: mtr and plugins

* in --parallel mode don't copy/symlinks plugins individually
  in each forked child's vardir, use the common parent vardir with
  all plugins
* move pam plugin specific code from mysql-test-run.pl to
  suite/plugins/suite.pm
parent d84792b6
...@@ -2580,82 +2580,72 @@ sub setup_vardir() { ...@@ -2580,82 +2580,72 @@ sub setup_vardir() {
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022"); copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");
# create a plugin dir and copy or symlink plugins into it # create a plugin dir and copy or symlink plugins into it
if ($source_dist) unless($plugindir)
{ {
$plugindir="$opt_vardir/plugins"; if ($source_dist)
mkpath($plugindir);
if (IS_WINDOWS)
{ {
if (!$opt_embedded_server) $plugindir="$opt_vardir/plugins";
mkpath($plugindir);
if (IS_WINDOWS)
{ {
for (<$bindir/storage/*$opt_vs_config/*.dll>, if (!$opt_embedded_server)
<$bindir/plugin/*$opt_vs_config/*.dll>,
<$bindir/libmariadb$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
{ {
my $pname=basename($_); for (<$bindir/storage/*$opt_vs_config/*.dll>,
copy rel2abs($_), "$plugindir/$pname"; <$bindir/plugin/*$opt_vs_config/*.dll>,
set_plugin_var($pname); <$bindir/libmariadb$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
set_plugin_var($pname);
}
} }
} }
} else
else
{
my $opt_use_copy= 1;
if (symlink "$opt_vardir/run", "$plugindir/symlink_test")
{
$opt_use_copy= 0;
unlink "$plugindir/symlink_test";
}
for (<$bindir/plugin/auth_pam/auth_pam_tool>)
{ {
mkpath("$plugindir/auth_pam_tool_dir"); my $opt_use_copy= 1;
if ($opt_use_copy) if (symlink "$opt_vardir/run", "$plugindir/symlink_test")
{ {
copy rel2abs($_), "$plugindir/auth_pam_tool_dir/auth_pam_tool" $opt_use_copy= 0;
unlink "$plugindir/symlink_test";
} }
else
for (<$bindir/storage/*/*.so>,
<$bindir/plugin/*/*.so>,
<$bindir/plugin/*/auth_pam_tool_dir>,
<$bindir/libmariadb/plugins/*/*.so>,
<$bindir/libmariadb/*.so>,
<$bindir/sql/*.so>)
{ {
symlink rel2abs($_), "$plugindir/auth_pam_tool_dir/auth_pam_tool"; my $pname=basename($_);
if ($opt_use_copy)
{
copy rel2abs($_), "$plugindir/$pname";
}
else
{
symlink rel2abs($_), "$plugindir/$pname";
}
set_plugin_var($pname);
} }
} }
}
for (<$bindir/storage/*/*.so>, else
<$bindir/plugin/*/*.so>, {
<$bindir/plugin/*/auth_pam_tool_dir>, # hm, what paths work for debs and for rpms ?
<$bindir/libmariadb/plugins/*/*.so>, for (<$bindir/lib64/mysql/plugin/*.so>,
<$bindir/libmariadb/*.so>, <$bindir/lib/mysql/plugin/*.so>,
<$bindir/sql/*.so>) <$bindir/lib64/mariadb/plugin/*.so>,
<$bindir/lib/mariadb/plugin/*.so>,
<$bindir/lib/plugin/*.so>, # bintar
<$bindir/lib/plugin/*.dll>)
{ {
my $pname=basename($_); my $pname=basename($_);
if ($opt_use_copy)
{
copy rel2abs($_), "$plugindir/$pname";
}
else
{
symlink rel2abs($_), "$plugindir/$pname";
}
set_plugin_var($pname); set_plugin_var($pname);
$plugindir=dirname($_) unless $plugindir;
} }
} }
} }
else
{
$plugindir= $mysqld_variables{'plugin-dir'} || '.';
# hm, what paths work for debs and for rpms ?
for (<$bindir/lib64/mysql/plugin/*.so>,
<$bindir/lib/mysql/plugin/*.so>,
<$bindir/lib64/mariadb/plugin/*.so>,
<$bindir/lib/mariadb/plugin/*.so>,
<$bindir/lib/plugin/*.so>, # bintar
<$bindir/lib/plugin/*.dll>)
{
my $pname=basename($_);
set_plugin_var($pname);
}
}
# Remove old log files # Remove old log files
foreach my $name (glob("r/*.progress r/*.log r/*.warnings")) foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
......
...@@ -4,6 +4,13 @@ use My::Platform; ...@@ -4,6 +4,13 @@ use My::Platform;
@ISA = qw(My::Suite); @ISA = qw(My::Suite);
if (-d '../sql') {
my $src = "$::bindir/plugin/auth_pam/auth_pam_tool";
my $dst = "$::plugindir/auth_pam_tool_dir/auth_pam_tool";
::mkpath( "$::plugindir/auth_pam_tool_dir");
symlink $src, $dst or ::copy $src, $dst;
}
sub cassandra_running() { sub cassandra_running() {
return 0 if IS_WINDOWS; return 0 if IS_WINDOWS;
system 'echo show version | cqlsh -3 2>/dev/null >/dev/null'; system 'echo show version | cqlsh -3 2>/dev/null >/dev/null';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment