Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2021 11:08:14 GMT
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c2ce92c39615 - stable/13 - sbin/bectl: Skip tests if sparse files are not supported
Message-ID:  <202104221108.13MB8ETx088317@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by arichardson:

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

commit c2ce92c39615ed259a7483d402aba8de30824923
Author:     Alex Richardson <arichardson@FreeBSD.org>
AuthorDate: 2021-02-03 09:31:32 +0000
Commit:     Alex Richardson <arichardson@FreeBSD.org>
CommitDate: 2021-04-22 09:41:29 +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
    
    (cherry picked from commit d6f4e1a8973daff2ffe4480b66c973562982ffc7)
---
 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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104221108.13MB8ETx088317>