8 SCRIPT_DIR=$(dirname $(readlink -f $0))
9 TOP=$(readlink -f $SCRIPT_DIR/../)
10 TEST_DEV=${TEST_DEV:-}
11 TEST_MNT=${TEST_MNT:-$TOP/tests/mnt}
12 RESULTS="$TOP/tests/misc-tests-results.txt"
13 IMAGE="$TOP/tests/test.img"
15 source $TOP/tests/common
17 # Allow child test to use $TOP and $RESULTS
20 # For custom script needs to verfiy recovery
23 # For tests that only use a loop device
27 mkdir -p $TEST_MNT || _fail "unable to create mount point on $TEST_MNT"
29 # test rely on corrupting blocks tool
30 check_prereq btrfs-corrupt-block
31 check_prereq btrfs-image
32 check_prereq btrfstune
35 # The tests are driven by their custom script called 'test.sh'
37 for i in $(find $TOP/tests/misc-tests -maxdepth 1 -mindepth 1 -type d | sort)
39 echo " [TEST] $(basename $i)"
41 echo "=== Entering $i" >> $RESULTS
42 if [ -x test.sh ]; then
45 _fail "test failed for case $(basename $i)"