From 31f477ee2002c78595bb21301a10533579423e8f Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Mon, 24 Feb 2020 15:05:34 -0300 Subject: [PATCH] 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 Signed-off-by: David Sterba --- tests/mkfs-tests/018-multidevice-overflow/test.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/mkfs-tests/018-multidevice-overflow/test.sh b/tests/mkfs-tests/018-multidevice-overflow/test.sh index 6c2f4dba..eb5c0a43 100755 --- a/tests/mkfs-tests/018-multidevice-overflow/test.sh +++ b/tests/mkfs-tests/018-multidevice-overflow/test.sh @@ -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"