3 # convert ext2/3/4 images to btrfs images, and make sure the results are
11 echo "$*" | tee -a convert-tests-results.txt
15 rm -f convert-tests-results.txt
20 echo "creating ext image with: $*" >> convert-tests-results.txt
21 # 256MB is the smallest acceptable btrfs image.
22 rm -f $here/test.img >> convert-tests-results.txt 2>&1 \
23 || _fail "could not remove test image file"
24 truncate -s 256M $here/test.img >> convert-tests-results.txt 2>&1 \
25 || _fail "could not create test image file"
26 $* -F $here/test.img >> convert-tests-results.txt 2>&1 \
27 || _fail "filesystem create failed"
28 $here/btrfs-convert $here/test.img >> convert-tests-results.txt 2>&1 \
29 || _fail "btrfs-convert failed"
30 $here/btrfs check $here/test.img >> convert-tests-results.txt 2>&1 \
31 || _fail "btrfs check detected errors"
34 # btrfs-convert requires 4k blocksize.
35 test "ext2" mke2fs -b 4096
36 test "ext3" mke2fs -j -b 4096
37 test "ext4" mke2fs -t ext4 -b 4096