-rm -f convert-tests-results.txt
-
-test(){
- echo " [TEST] $1"
- shift
- echo "creating ext image with: $*" >> convert-tests-results.txt
- # 256MB is the smallest acceptable btrfs image.
- rm -f $here/test.img >> convert-tests-results.txt 2>&1 \
- || _fail "could not remove test image file"
- truncate -s 256M $here/test.img >> convert-tests-results.txt 2>&1 \
- || _fail "could not create test image file"
- $* -F $here/test.img >> convert-tests-results.txt 2>&1 \
- || _fail "filesystem create failed"
- $here/btrfs-convert $here/test.img >> convert-tests-results.txt 2>&1 \
- || _fail "btrfs-convert failed"
- $here/btrfs check $here/test.img >> convert-tests-results.txt 2>&1 \
- || _fail "btrfs check detected errors"
+ testdir="$1"
+ testname=$(basename "$testdir")
+ echo " [TEST/conv] $testname"
+ cd "$testdir"
+ echo "=== Entering $testname" >> "$RESULTS"
+ if [ -x test.sh ]; then
+ # Only support custom test scripts
+ ./test.sh
+ if [ $? -ne 0 ]; then
+ if [[ $TEST_LOG =~ dump ]]; then
+ # the logs can be large and may exceed the
+ # limits, use 4MB for now
+ tail -c 3900000 "$RESULTS"
+ fi
+ _fail "test failed for case $testname"
+ fi
+ else
+ _fail "custom test script not found"
+ fi