From e5f80994640df9abdb181c6db1513d8de744c73c Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 3 Jun 2016 16:01:51 +0200 Subject: [PATCH] btrfs-progs: tests: unify test drivers Remove unnecessary code, add exports to all common variables. Signed-off-by: David Sterba --- tests/cli-tests.sh | 3 +-- tests/convert-tests.sh | 6 ++---- tests/fsck-tests.sh | 10 +++------- tests/fuzz-tests.sh | 3 +-- tests/misc-tests.sh | 6 +----- tests/mkfs-tests.sh | 6 +----- 6 files changed, 9 insertions(+), 25 deletions(-) diff --git a/tests/cli-tests.sh b/tests/cli-tests.sh index e65e7f5..72f7865 100755 --- a/tests/cli-tests.sh +++ b/tests/cli-tests.sh @@ -2,8 +2,6 @@ # # command line interface coverage tests -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) @@ -17,6 +15,7 @@ export TOP export RESULTS export LANG export IMAGE +export TEST_DEV rm -f $RESULTS diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index c0080b9..064540f 100755 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -2,10 +2,7 @@ # # convert ext2/3/4 images to btrfs images, and make sure the results are # clean. -# -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) @@ -16,10 +13,11 @@ IMAGE="$TOP/tests/test.img" source $TOP/tests/common source $TOP/tests/common.convert -# Allow child test to use $TOP and $RESULTS export TOP export RESULTS export LANG +export IMAGE +export TEST_DEV rm -f $RESULTS diff --git a/tests/fsck-tests.sh b/tests/fsck-tests.sh index fb86163..d1cd732 100755 --- a/tests/fsck-tests.sh +++ b/tests/fsck-tests.sh @@ -1,25 +1,21 @@ #!/bin/bash # # loop through all of our bad images and make sure fsck repairs them properly -# -# It's GPL, same as everything else in this tree. -# -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) TEST_DEV=${TEST_DEV:-} RESULTS="$TOP/tests/fsck-tests-results.txt" +IMAGE="$TOP/tests/test.img" source $TOP/tests/common -# Allow child test to use $TOP and $RESULTS export TOP export RESULTS -# For custom script needs to verify recovery export LANG +export IMAGE +export TEST_DEV rm -f $RESULTS diff --git a/tests/fuzz-tests.sh b/tests/fuzz-tests.sh index 204dce2..29691ca 100755 --- a/tests/fuzz-tests.sh +++ b/tests/fuzz-tests.sh @@ -2,8 +2,6 @@ # # misc tests on fuzzed or crafted images -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) @@ -17,6 +15,7 @@ export TOP export RESULTS export LANG export IMAGE +export TEST_DEV rm -f $RESULTS diff --git a/tests/misc-tests.sh b/tests/misc-tests.sh index 0cf8c4b..eefe8a8 100755 --- a/tests/misc-tests.sh +++ b/tests/misc-tests.sh @@ -2,8 +2,6 @@ # # Misc tests -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) @@ -13,12 +11,10 @@ IMAGE="$TOP/tests/test.img" source $TOP/tests/common -# Allow child test to use $TOP and $RESULTS export TOP export RESULTS -# For custom script needs to verify recovery export LANG -# For tests that only use a loop device +export TEST_DEV export IMAGE rm -f $RESULTS diff --git a/tests/mkfs-tests.sh b/tests/mkfs-tests.sh index 363a865..1afc028 100755 --- a/tests/mkfs-tests.sh +++ b/tests/mkfs-tests.sh @@ -2,8 +2,6 @@ # # mkfs.btrfs tests -unset TOP -unset LANG LANG=C SCRIPT_DIR=$(dirname $(readlink -f $0)) TOP=$(readlink -f $SCRIPT_DIR/../) @@ -13,13 +11,11 @@ IMAGE="$TOP/tests/test.img" source $TOP/tests/common -# Allow child test to use $TOP and $RESULTS export TOP export RESULTS -# For custom script needs to verify recovery export LANG -# For tests that only use a loop device export IMAGE +export TEST_DEV rm -f $RESULTS -- 2.7.4