source $TOP/tests/common
+# Allow child test to use $TOP and $RESULTS
+export TOP
+export RESULTS
+export LANG
+
rm -f $RESULTS
setup_root_helper
CHECKSUMTMP=$(mktemp --tmpdir btrfs-progs-convert.XXXXXXXXXX)
+run_one_test() {
+ local testname
+
+ testname="$1"
+ echo " [TEST/conv] $testname"
+ cd $testname
+ echo "=== Entering $testname" >> $RESULTS
+ if [ -x test.sh ]; then
+ # Difference convert test case needs different tools to restore
+ # and check image, so only support custom test scripts
+ ./test.sh
+ if [ $? -ne 0 ]; then
+ _fail "test failed for case $(basename $testname)"
+ fi
+ else
+ _fail "custom test script not found"
+ fi
+}
+
generate_dataset() {
dataset_type="$1"
convert_test "$feature" "ext4 64k nodesize" 65536 mke2fs -t ext4 -b 4096
done
+# Test special images
+for i in $(find $TOP/tests/convert-tests -maxdepth 1 -mindepth 1 -type d \
+ ${TEST:+-name "$TEST"} | sort)
+do
+ run_one_test "$i"
+done
+
rm $CHECKSUMTMP