Page MenuHomeFreeBSD

du_test: Skip three tests if sparse files are not supported
ClosedPublic

Authored by arichardson on Jan 28 2021, 10:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 3:19 PM
Unknown Object (File)
Sep 30 2024, 10:30 PM
Unknown Object (File)
Sep 30 2024, 10:28 PM
Unknown Object (File)
Sep 30 2024, 10:13 PM
Unknown Object (File)
Sep 30 2024, 8:33 PM
Unknown Object (File)
Sep 23 2024, 2:35 PM
Unknown Object (File)
Sep 21 2024, 11:16 AM
Unknown Object (File)
Sep 5 2024, 9:27 AM
Subscribers

Details

Summary

This fixes running the du tests with /tmp as tmpfs (which is what we do in the
CheriBSD CI).

Obtained from: CheriBSD
Co-authored-by: Brooks Davis <brooks@FreeBSD.org>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36652
Build 33541: arc lint + arc unit

Event Timeline

ngie requested changes to this revision.Jan 28 2021, 11:10 PM

This isn't the right approach; please use getconf MIN_HOLE_SIZE instead, like the ls tests do

83 create_test_inputs2()
84 {
85         create_test_dir
86 
87         if ! getconf MIN_HOLE_SIZE "$(pwd)"; then
88             echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files probably" \
89                  "not supported by file system"
90             mount
91             atf_skip "Test's work directory does not support sparse files;" \
92                      "try with a different TMPDIR?"
93         fi
This revision now requires changes to proceed.Jan 28 2021, 11:10 PM
In D28398#635444, @ngie wrote:

This isn't the right approach; please use getconf MIN_HOLE_SIZE instead, like the ls tests do

83 create_test_inputs2()
84 {
85         create_test_dir
86 
87         if ! getconf MIN_HOLE_SIZE "$(pwd)"; then
88             echo "getconf MIN_HOLE_SIZE $(pwd) failed; sparse files probably" \
89                  "not supported by file system"
90             mount
91             atf_skip "Test's work directory does not support sparse files;" \
92                      "try with a different TMPDIR?"
93         fi

Thanks, I was not aware of MIN_HOLE_SIZE. Seems to report a sensible value on UFS and fail on tmpfs and smbfs. Will update the patch tomorrow.

With this change I now get three skipped tests by default, and if I do env TMPDIR=/root/tmp to run them on UFS all of them pass.

This might be a good thing to add to a general purpose library.

This revision is now accepted and ready to land.Feb 3 2021, 3:47 PM