3 # convert ext2/3/4 images to btrfs images, and make sure the results are
7 SCRIPT_DIR=$(dirname $(readlink -f "$0"))
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/convert-tests-results.txt"
15 IMAGE="$TEST_TOP/test.img"
17 source "$TEST_TOP/common"
18 source "$TEST_TOP/common.convert"
30 check_kernel_support_reiserfs
31 # anything expected by common.convert
32 check_global_prereq getfacl
33 check_global_prereq setfacl
34 check_global_prereq md5sum
41 testname=$(basename "$testdir")
42 echo " [TEST/conv] $testname"
44 echo "=== Entering $testname" >> "$RESULTS"
45 if [ -x test.sh ]; then
46 # Only support custom test scripts
49 if [[ $TEST_LOG =~ dump ]]; then
50 # the logs can be large and may exceed the
51 # limits, use 4MB for now
52 tail -c 3900000 "$RESULTS"
54 _fail "test failed for case $testname"
57 _fail "custom test script not found"
62 for i in $(find "$TEST_TOP/convert-tests" -maxdepth 1 -mindepth 1 -type d \
63 ${TEST:+-name "$TEST"} | sort)