mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
mysql-test/mysql-test-run.pl + mysql-test/mysql-test-run.sh
Necessary changes if one of the test scripts is to be used with a RPM installation (bug#17194). This change handles finding the server and the other programs, but it does not solve the problem to get a writable "var" directory. If we want to avoid world-writable directories below "/usr/share/mysql-test" (and we do!), any automatic solution would require fixed decisions which may not match the local installation. For the Perl script, use "--vardir"; for the shell script, create "mysql-test/var" manually. mysql-test/mysql-test-run.pl: Modifications to use this script in a RPM installation (bug#17194): - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin"). - A "mysql-bench" might not exist. - "mysql-test" is owned by root and not world-writable, so "var" must be put somewhere else. - The server, "mysqld", is in a different location, "/usr/sbin". Note that the "--vardir" option must be used in a RPM installation, unless "mysql-test" is made writable for the user who runs the tests (not done automatically). mysql-test/mysql-test-run.sh: Necessary changes if this script is to be used with a RPM installation (bug#17194): - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin"). - The server, "mysqld", is in a different location, "/usr/sbin". Note that these changes are not sufficient, as the user needs a writable "mysql-test/var" subdirectory. Either this is created manually, or the script can not be used. An alternative is the corresponding Perl script which supports a "--vardir" option.
This commit is contained in:
@ -431,7 +431,7 @@ sub initial_setup () {
|
||||
|
||||
$glob_hostname= mtr_short_hostname();
|
||||
|
||||
# 'basedir' is always parent of "mysql-test" directory
|
||||
# 'basedir' is always above "mysql-test" directory ...
|
||||
$glob_mysql_test_dir= cwd();
|
||||
if ( $glob_cygwin_perl )
|
||||
{
|
||||
@ -442,8 +442,19 @@ sub initial_setup () {
|
||||
chomp($glob_mysql_test_dir);
|
||||
chomp($glob_cygwin_shell);
|
||||
}
|
||||
# ... direct parent for "tar.gz" installations, ...
|
||||
$glob_basedir= dirname($glob_mysql_test_dir);
|
||||
# ... or one more level up, for RPM installations.
|
||||
if ( ! -d "$glob_basedir/bin" )
|
||||
{
|
||||
$glob_basedir= dirname($glob_basedir);
|
||||
}
|
||||
# "mysql-bench" might be installed, but need not be.
|
||||
$glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable
|
||||
if ( ! -d "$glob_mysql_bench_dir" )
|
||||
{
|
||||
$glob_mysql_bench_dir= undef;
|
||||
}
|
||||
|
||||
# needs to be same length to test logging (FIXME what???)
|
||||
$path_slave_load_tmpdir= "../../var/tmp";
|
||||
@ -646,6 +657,13 @@ sub command_line_setup () {
|
||||
$opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
|
||||
}
|
||||
|
||||
# Ensure a proper error message
|
||||
mkpath("$opt_vardir");
|
||||
unless ( -d $opt_vardir and -w $opt_vardir )
|
||||
{
|
||||
mtr_error("Writable 'var' directory is needed, use the '--vardir' option");
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# If not set, set these to defaults
|
||||
# --------------------------------------------------------------------------
|
||||
@ -984,7 +1002,8 @@ sub executable_setup () {
|
||||
else
|
||||
{
|
||||
$exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld",
|
||||
"$glob_basedir/bin/mysqld");
|
||||
"$glob_basedir/bin/mysqld",
|
||||
"$glob_basedir/sbin/mysqld");
|
||||
}
|
||||
|
||||
if ( $glob_use_embedded_server )
|
||||
|
Reference in New Issue
Block a user