diff options
author | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-07-26 13:24:39 +0100 |
---|---|---|
committer | Dimitri John Ledkov <xnox@ubuntu.com> | 2016-07-26 13:24:39 +0100 |
commit | 3d69435ee3292b4b1db2d61c4784789d75883821 (patch) | |
tree | 2c0edc9d9501374799875af36259089feb99d48c /tests/mkfs-tests/004-rootdir-keeps-size/test.sh |
Imported Upstream version 4.6.1
Diffstat (limited to 'tests/mkfs-tests/004-rootdir-keeps-size/test.sh')
-rwxr-xr-x | tests/mkfs-tests/004-rootdir-keeps-size/test.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/mkfs-tests/004-rootdir-keeps-size/test.sh b/tests/mkfs-tests/004-rootdir-keeps-size/test.sh new file mode 100755 index 00000000..7038c8ea --- /dev/null +++ b/tests/mkfs-tests/004-rootdir-keeps-size/test.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# make sure that mkfs.btrfs --rootsize does not change size of the image + +source $TOP/tests/common + +check_prereq mkfs.btrfs + +prepare_test_dev + +test_mkfs_with_size() { + local size + local imgsize + local tmp + + size="$1" + run_check truncate -s$size $TEST_DEV + imgsize=$(run_check_stdout stat --format=%s $TEST_DEV) + run_check $SUDO_HELPER $TOP/mkfs.btrfs -f \ + --rootdir $TOP/Documentation \ + $TEST_DEV + tmp=$(run_check_stdout stat --format=%s $TEST_DEV) + if ! [ "$imgsize" = "$tmp" ]; then + _fail "image size changed from $imgsize to $tmp" + fi +} + +test_mkfs_with_size 128M +test_mkfs_with_size 256M +test_mkfs_with_size 512M +test_mkfs_with_size 1G +test_mkfs_with_size 2G |