2015-11-05 13:22:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# make sure that mkfs.btrfs --rootsize does not change size of the image
|
|
|
|
|
2023-04-19 15:08:41 +00:00
|
|
|
source "$TEST_TOP/common" || exit
|
2015-11-05 13:22:10 +00:00
|
|
|
|
|
|
|
check_prereq mkfs.btrfs
|
2016-01-12 14:16:11 +00:00
|
|
|
|
2015-11-05 13:22:10 +00:00
|
|
|
prepare_test_dev
|
|
|
|
|
|
|
|
test_mkfs_with_size() {
|
|
|
|
local size
|
|
|
|
local imgsize
|
|
|
|
local tmp
|
|
|
|
|
|
|
|
size="$1"
|
2018-03-23 15:34:30 +00:00
|
|
|
run_check truncate -s"$size" "$TEST_DEV"
|
|
|
|
imgsize=$(run_check_stdout stat --format=%s "$TEST_DEV")
|
2019-06-05 17:09:38 +00:00
|
|
|
run_check_mkfs_test_dev --rootdir "$INTERNAL_BIN/Documentation"
|
2018-03-23 15:34:30 +00:00
|
|
|
tmp=$(run_check_stdout stat --format=%s "$TEST_DEV")
|
2015-11-05 13:22:10 +00:00
|
|
|
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
|