From d6f4e1a8973daff2ffe4480b66c973562982ffc7 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 3 Feb 2021 09:31:32 +0000 Subject: [PATCH] sbin/bectl: Skip tests if sparse files are not supported The tests create a 1GB test file and this causes the tests to fail in the CheriBSD CI setup where we run tests with a tmpfs mount on /tmp. Tmpfs does not support sparse files and it appears that tmpfs default to creating a 1GB mount, so there is not enough space to run these tests. Instead of checking for at least 1GB of free space, this commit skips the tests on file systems that do not support sparse files. Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28463 --- sbin/bectl/tests/bectl_test.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 36c92235b6d8..221fe21e29ed 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -49,6 +49,13 @@ bectl_create_setup() atf_check test -n "$zpool" kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" + if ! getconf MIN_HOLE_SIZE "$(pwd)"; then + echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files " \ + "probably not supported by file system" + mount + atf_skip "Test's work directory does not support sparse files;" \ + "try with a different TMPDIR?" + fi atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -R ${mnt} ${zpool} ${disk}