diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-12-27 22:10:17 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-12-27 23:17:28 +0100 |
commit | 1300627a5dcffdb005e2c31e0ba88f47fa519742 (patch) | |
tree | 008457f2c0558ec34b9b2a8186b3bb99481156ac | |
parent | 462808f3b65b60958eaf8013b80857e341cc9f6c (diff) | |
download | mariadb-git-1300627a5dcffdb005e2c31e0ba88f47fa519742.tar.gz |
MDEV-14309 MTR tests require perl-Env which is not always in the default installation
* don't use Env module in tests, use $ENV{xxx} instead
* collateral changes:
** $file in the error message was unset
** $file in the other error message was unset too :)
** source file arguments are conventionally upper-cased
** abort the test (die) on error, don't just echo/exit
-rw-r--r-- | mysql-test/include/truncate_file.inc | 11 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_manual_change_index_file.test | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc index 2326d6c0b94..fe88cb05bd9 100644 --- a/mysql-test/include/truncate_file.inc +++ b/mysql-test/include/truncate_file.inc @@ -1,16 +1,11 @@ # truncate a giving file, all contents of the file are be cleared -if (!$file) +if (!$TRUNCATE_FILE) { - --echo Please assign a file name to $file!! - exit; + die TRUNCATE_FILE is not set; } -let TRUNCATE_FILE= $file; - perl; -use Env; -Env::import('TRUNCATE_FILE'); -open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; +open FILE, '>', $ENV{TRUNCATE_FILE} or die "open(>$ENV{TRUNCATE_FILE}): $!"; close FILE; EOF diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 981cecb66ad..1c087c550d0 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -25,7 +25,7 @@ sync_slave_with_master; connection master; # Delete './master-bin.000001' from index file. let $MYSQLD_DATADIR= `SELECT @@DATADIR`; -let $file= $MYSQLD_DATADIR/master-bin.index; +let TRUNCATE_FILE= $MYSQLD_DATADIR/master-bin.index; source include/truncate_file.inc; if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) |