2 # make sure that mkfs.btrfs --rootsize does not change size of the image
4 source "$TEST_TOP/common"
6 check_prereq mkfs.btrfs
10 test_mkfs_with_size() {
16 run_check truncate -s"$size" "$TEST_DEV"
17 imgsize=$(run_check_stdout stat --format=%s "$TEST_DEV")
18 run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f \
19 --rootdir "$INTERNAL_BIN/Documentation" \
21 tmp=$(run_check_stdout stat --format=%s "$TEST_DEV")
22 if ! [ "$imgsize" = "$tmp" ]; then
23 _fail "image size changed from $imgsize to $tmp"
27 test_mkfs_with_size 128M
28 test_mkfs_with_size 256M
29 test_mkfs_with_size 512M
30 test_mkfs_with_size 1G
31 test_mkfs_with_size 2G