git: d6f4e1a8973d - main - sbin/bectl: Skip tests if sparse files are not supported

Alex Richardson arichardson at FreeBSD.org
Wed Feb 3 09:38:39 UTC 2021


The branch main has been updated by arichardson:

URL: https://cgit.FreeBSD.org/src/commit/?id=d6f4e1a8973daff2ffe4480b66c973562982ffc7

commit d6f4e1a8973daff2ffe4480b66c973562982ffc7
Author:     Alex Richardson <arichardson at FreeBSD.org>
AuthorDate: 2021-02-03 09:31:32 +0000
Commit:     Alex Richardson <arichardson at FreeBSD.org>
CommitDate: 2021-02-03 09:31:32 +0000

    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}


More information about the dev-commits-src-main mailing list