btrfs-progs: mkfs-tests: skip test if truncate fails with EFBIG

The truncate command can fail in some platforms like PPC32 because it
can't create files up to 6EiB in size. Skip the test if this was the
problem why truncate failed.

Issue: #192
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Marcos Paulo de Souza 2020-02-24 15:05:34 -03:00 committed by David Sterba
parent 6ec6c11ba1
commit 31f477ee20
1 changed files with 11 additions and 1 deletions

View File

@ -14,7 +14,17 @@ prepare_test_dev
run_check_mkfs_test_dev
run_check_mount_test_dev
run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img1"
# truncate can fail with EFBIG if the OS cannot create a 6EiB file
run_mayfail $SUDO_HELPER truncate -s 6E "$TEST_MNT/img1"
ret=$?
if [ $ret == 27 ]; then
_not_run "Current kernel could not create a 6E file"
fi
if [ $ret -gt 0 ]; then
_fail "truncate -s 6E failed: $ret"
fi
run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img2"
run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img3"