6 SCRIPT_DIR=$(dirname $(readlink -f "$0"))
7 INTERNAL_BIN=$(readlink -f "$SCRIPT_DIR/../")
8 TEST_TOP=$(readlink -f "$SCRIPT_DIR/../tests/")
9 TOP=$(readlink -f "$SCRIPT_DIR/../")
10 if ! [ -f "$TOP/btrfs" ];then
11 TOP=$(dirname `which btrfs`)
13 TEST_DEV=${TEST_DEV:-}
14 RESULTS="$TEST_TOP/mkfs-tests-results.txt"
15 IMAGE="$TEST_TOP/test.img"
17 source "$TEST_TOP/common"
29 check_prereq mkfs.btrfs
33 # The tests are driven by their custom script called 'test.sh'
35 for i in $(find "$TEST_TOP/mkfs-tests" -maxdepth 1 -mindepth 1 -type d \
36 ${TEST:+-name "$TEST"} | sort)
38 echo " [TEST/mkfs] $(basename $i)"
40 echo "=== Entering $i" >> "$RESULTS"
41 if [ -x test.sh ]; then
44 if [[ $TEST_LOG =~ dump ]]; then
47 _fail "test failed for case $(basename $i)"