btrfs-progs: tests: unify test drivers
Remove unnecessary code, add exports to all common variables. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
b5ab8d42b7
commit
e5f8099464
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# command line interface coverage tests
|
# command line interface coverage tests
|
||||||
|
|
||||||
unset TOP
|
|
||||||
unset LANG
|
|
||||||
LANG=C
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
|
@ -17,6 +15,7 @@ export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
export LANG
|
export LANG
|
||||||
export IMAGE
|
export IMAGE
|
||||||
|
export TEST_DEV
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
#
|
#
|
||||||
# convert ext2/3/4 images to btrfs images, and make sure the results are
|
# convert ext2/3/4 images to btrfs images, and make sure the results are
|
||||||
# clean.
|
# clean.
|
||||||
#
|
|
||||||
|
|
||||||
unset TOP
|
|
||||||
unset LANG
|
|
||||||
LANG=C
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
|
@ -16,10 +13,11 @@ IMAGE="$TOP/tests/test.img"
|
||||||
source $TOP/tests/common
|
source $TOP/tests/common
|
||||||
source $TOP/tests/common.convert
|
source $TOP/tests/common.convert
|
||||||
|
|
||||||
# Allow child test to use $TOP and $RESULTS
|
|
||||||
export TOP
|
export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
export LANG
|
export LANG
|
||||||
|
export IMAGE
|
||||||
|
export TEST_DEV
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# loop through all of our bad images and make sure fsck repairs them properly
|
# 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
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
TEST_DEV=${TEST_DEV:-}
|
TEST_DEV=${TEST_DEV:-}
|
||||||
RESULTS="$TOP/tests/fsck-tests-results.txt"
|
RESULTS="$TOP/tests/fsck-tests-results.txt"
|
||||||
|
IMAGE="$TOP/tests/test.img"
|
||||||
|
|
||||||
source $TOP/tests/common
|
source $TOP/tests/common
|
||||||
|
|
||||||
# Allow child test to use $TOP and $RESULTS
|
|
||||||
export TOP
|
export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
# For custom script needs to verify recovery
|
|
||||||
export LANG
|
export LANG
|
||||||
|
export IMAGE
|
||||||
|
export TEST_DEV
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# misc tests on fuzzed or crafted images
|
# misc tests on fuzzed or crafted images
|
||||||
|
|
||||||
unset TOP
|
|
||||||
unset LANG
|
|
||||||
LANG=C
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
|
@ -17,6 +15,7 @@ export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
export LANG
|
export LANG
|
||||||
export IMAGE
|
export IMAGE
|
||||||
|
export TEST_DEV
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# Misc tests
|
# Misc tests
|
||||||
|
|
||||||
unset TOP
|
|
||||||
unset LANG
|
|
||||||
LANG=C
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
|
@ -13,12 +11,10 @@ IMAGE="$TOP/tests/test.img"
|
||||||
|
|
||||||
source $TOP/tests/common
|
source $TOP/tests/common
|
||||||
|
|
||||||
# Allow child test to use $TOP and $RESULTS
|
|
||||||
export TOP
|
export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
# For custom script needs to verify recovery
|
|
||||||
export LANG
|
export LANG
|
||||||
# For tests that only use a loop device
|
export TEST_DEV
|
||||||
export IMAGE
|
export IMAGE
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#
|
#
|
||||||
# mkfs.btrfs tests
|
# mkfs.btrfs tests
|
||||||
|
|
||||||
unset TOP
|
|
||||||
unset LANG
|
|
||||||
LANG=C
|
LANG=C
|
||||||
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||||
TOP=$(readlink -f $SCRIPT_DIR/../)
|
TOP=$(readlink -f $SCRIPT_DIR/../)
|
||||||
|
@ -13,13 +11,11 @@ IMAGE="$TOP/tests/test.img"
|
||||||
|
|
||||||
source $TOP/tests/common
|
source $TOP/tests/common
|
||||||
|
|
||||||
# Allow child test to use $TOP and $RESULTS
|
|
||||||
export TOP
|
export TOP
|
||||||
export RESULTS
|
export RESULTS
|
||||||
# For custom script needs to verify recovery
|
|
||||||
export LANG
|
export LANG
|
||||||
# For tests that only use a loop device
|
|
||||||
export IMAGE
|
export IMAGE
|
||||||
|
export TEST_DEV
|
||||||
|
|
||||||
rm -f $RESULTS
|
rm -f $RESULTS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue