mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-27 16:02:56 +00:00
f6bbe06c08
Executing the script inside the directories as './test.sh' is not supposed to work but could happen accidentally. With an exit after attempting to source the we can fix that. Signed-off-by: David Sterba <dsterba@suse.com>
30 lines
672 B
Bash
Executable File
30 lines
672 B
Bash
Executable File
#!/bin/bash
|
|
# make sure that mkfs.btrfs --rootsize does not change size of the image
|
|
|
|
source "$TEST_TOP/common" || exit
|
|
|
|
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_mkfs_test_dev --rootdir "$INTERNAL_BIN/Documentation"
|
|
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
|