[PATCHv2] progs: mkfs-tests: Skip test if truncate failed with EFBIG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>

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

[1]: https://github.com/kdave/btrfs-progs/issues/192

Signed-off-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
---
Changes from v1:
* Only check if truncate failed with EFBIG instead of skipping the test on 32bit
  platforms (Suggested by Wenruo)

 tests/mkfs-tests/018-multidevice-overflow/test.sh | 10 +++++++++-
 1 file changed, 9 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..14ecbf89 100755
--- a/tests/mkfs-tests/018-multidevice-overflow/test.sh
+++ b/tests/mkfs-tests/018-multidevice-overflow/test.sh
@@ -14,7 +14,15 @@ 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 created a 6E 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
+
+[ $ret -gt 0 ] && _fail "Truncate command failed: $ret"
+
 run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img2"
 run_check $SUDO_HELPER truncate -s 6E "$TEST_MNT/img3"
 
-- 
2.25.0




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux