Skip to content
Permalink
Browse files

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
  • Loading branch information...
vuvova committed Jul 1, 2019
1 parent d84792b commit 4fef644303ecdf6ea88ea40d3733dea6bd2cf41d
Showing with 55 additions and 58 deletions.
  1. +48 −58 mysql-test/mysql-test-run.pl
  2. +7 −0 mysql-test/suite/plugins/suite.pm
@@ -2580,82 +2580,72 @@ ()
copytree("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data", "0022");

# create a plugin dir and copy or symlink plugins into it
if ($source_dist)
unless($plugindir)
{
$plugindir="$opt_vardir/plugins";
mkpath($plugindir);
if (IS_WINDOWS)
if ($source_dist)
{
if (!$opt_embedded_server)
$plugindir="$opt_vardir/plugins";
mkpath($plugindir);
if (IS_WINDOWS)
{
for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>,
<$bindir/libmariadb$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
if (!$opt_embedded_server)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
set_plugin_var($pname);
for (<$bindir/storage/*$opt_vs_config/*.dll>,
<$bindir/plugin/*$opt_vs_config/*.dll>,
<$bindir/libmariadb$opt_vs_config/*.dll>,
<$bindir/sql$opt_vs_config/*.dll>)
{
my $pname=basename($_);
copy rel2abs($_), "$plugindir/$pname";
set_plugin_var($pname);
}
}
}
}
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>)
else
{
mkpath("$plugindir/auth_pam_tool_dir");
if ($opt_use_copy)
my $opt_use_copy= 1;
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>,
<$bindir/plugin/*/*.so>,
<$bindir/plugin/*/auth_pam_tool_dir>,
<$bindir/libmariadb/plugins/*/*.so>,
<$bindir/libmariadb/*.so>,
<$bindir/sql/*.so>)
}
else
{
# 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($_);
if ($opt_use_copy)
{
copy rel2abs($_), "$plugindir/$pname";
}
else
{
symlink rel2abs($_), "$plugindir/$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
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
@@ -4,6 +4,13 @@ use My::Platform;

@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() {
return 0 if IS_WINDOWS;
system 'echo show version | cqlsh -3 2>/dev/null >/dev/null';

0 comments on commit 4fef644

Please sign in to comment.
You can’t perform that action at this time.