2 # test if the reported minimal size of mkfs.btrfs is valid
4 source "$TOP/tests/common"
6 check_prereq mkfs.btrfs
13 # 1M should be small enough to reliably fail, we use the output to get
14 # the minimal device size for the given option combination
16 output=$(run_mustfail_stdout "mkfs.btrfs for small image" \
17 "$TOP/mkfs.btrfs" -f $@ "$TEST_DEV")
18 good_size=$(echo "$output" | grep -oP "(?<=is )\d+")
20 prepare_test_dev "$good_size"
21 echo "Minimal device size is $good_size" >> "$RESULTS"
22 run_check $TOP/mkfs.btrfs -f $@ "$TEST_DEV"
23 run_check_mount_test_dev
24 run_check_umount_test_dev
27 do_test -n 4k -m single -d single
28 do_test -n 4k -m single -d dup
29 do_test -n 4k -m dup -d single
30 do_test -n 4k -m dup -d dup
32 do_test -n 8k -m single -d single
33 do_test -n 8k -m single -d dup
34 do_test -n 8k -m dup -d single
35 do_test -n 8k -m dup -d dup
37 do_test -n 16k -m single -d single
38 do_test -n 16k -m single -d dup
39 do_test -n 16k -m dup -d single
40 do_test -n 16k -m dup -d dup
42 # Temporary: disable the following tests as they fail inside travis but run
43 # fine otherwise. This is probably caused by kernel version, 4.4 fails and 4.14
46 # root_helper mount -t btrfs -o loop /home/travis/build/kdave/btrfs-progs/tests/test.img /home/travis/build/kdave/btrfs-progs/tests/mnt
47 # mount: No space left on device
48 # failed: root_helper mount -t btrfs -o loop /home/travis/build/kdave/btrfs-progs/tests/test.img /home/travis/build/kdave/btrfs-progs/tests/mnt
49 # test failed for case 010-minimal-size
51 if [ "$TRAVIS" = true ]; then
55 do_test -n 32k -m single -d single
56 do_test -n 32k -m single -d dup
57 do_test -n 32k -m dup -d single
58 do_test -n 32k -m dup -d dup
60 do_test -n 64k -m single -d single
61 do_test -n 64k -m single -d dup
62 do_test -n 64k -m dup -d single
63 do_test -n 64k -m dup -d dup