From 1300627a5dcffdb005e2c31e0ba88f47fa519742 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 27 Dec 2017 22:10:17 +0100 Subject: [PATCH] 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 --- mysql-test/include/truncate_file.inc | 11 +++-------- .../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 2326d6c0b940c..fe88cb05bd92f 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 981cecb66ad43..1c087c550d0e9 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')`)