From d4d500d341a352c882169a67b1a0c8119ed4257e Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Mon, 31 Aug 2015 13:04:36 +0800 Subject: btrfs-progs: tests: Introduce init_env to initialize common env variant For example, $TEST_DIR is common used in severial tests, and have duplicated code for initialize. These duplicated code not only benifits harddisk vendor, but have inconsistent details, as: convert-tests.sh: lack of mkdir fsck-tests/012-leaf-corruption/test.sh: unnecessary mkdir fsck-tests/013-extent-tree-rebuild/test.sh: unnecessary init misc-tests/XXX ... And severial error message: _fail "unable to create mount point on $TEST_MNT" _fail "failed to create mount point" ... This patch move initizlizaton of $TEST_DIR to common init_env(), to avoid above problem, and init_env() can be used to add more things in future. Signed-off-by: Zhao Lei Signed-off-by: David Sterba --- tests/fsck-tests.sh | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/fsck-tests.sh') diff --git a/tests/fsck-tests.sh b/tests/fsck-tests.sh index 73538fec..b910e851 100755 --- a/tests/fsck-tests.sh +++ b/tests/fsck-tests.sh @@ -11,7 +11,6 @@ LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) TEST_DEV=${TEST_DEV:-} -TEST_MNT=${TEST_MNT:-$TOP/tests/mnt} RESULTS="$TOP/tests/fsck-tests-results.txt" source $TOP/tests/common @@ -20,11 +19,9 @@ source $TOP/tests/common export TOP export RESULTS # For custom script needs to verfiy recovery -export TEST_MNT export LANG rm -f $RESULTS -mkdir -p $TEST_MNT || _fail "unable to create mount point on $TEST_MNT" # test rely on corrupting blocks tool check_prereq btrfs-corrupt-block -- cgit v1.2.3