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)
Feb 20 2024, 2:44 AM
Unknown Object (File)
Feb 20 2024, 2:44 AM
Unknown Object (File)
Jan 8 2024, 8:16 PM
Unknown Object (File)
Dec 20 2023, 4:27 AM
Unknown Object (File)
Dec 14 2023, 8:14 PM
Unknown Object (File)
Nov 21 2023, 2:08 PM
Unknown Object (File)
Nov 21 2023, 2:04 PM
Unknown Object (File)
Oct 26 2023, 3:11 PM
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