Skip to content

ZTS: remove outdated FreeBSD skip from trim tests#18398

Open
chrislongros wants to merge 2 commits intoopenzfs:masterfrom
chrislongros:file-punch-holes
Open

ZTS: remove outdated FreeBSD skip from trim tests#18398
chrislongros wants to merge 2 commits intoopenzfs:masterfrom
chrislongros:file-punch-holes

Conversation

@chrislongros
Copy link
Copy Markdown
Contributor

@chrislongros chrislongros commented Apr 3, 2026

FreeBSD has supported hole punching via fspacectl(2) since FreeBSD 14.0
and the test library already handles this using truncate -d. Remove
the skip that prevented trim tests from running on FreeBSD.

Tests will still skip if the hardware does not support TRIM/UNMAP,
which is checked separately via diskinfo.

The second commit fixes portability issues exposed by enabling the tests.

Tested on FreeBSD 16.0-CURRENT: 26 PASS, 3 SKIP, 0 FAIL.

Signed-off-by: Christos Longros chris.longros@gmail.com

Copy link
Copy Markdown
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It is good to have proper test coverage.

@behlendorf
Copy link
Copy Markdown
Contributor

There are a couple lines in tests/test-runner/bin/zts-report.py.in which need to be deleted.

Tests with result of PASS that are unexpected:
    PASS cli_root/zpool_wait/zpool_wait_trim_basic (expected SKIP)
    PASS cli_root/zpool_wait/zpool_wait_trim_cancel (expected SKIP)
    PASS cli_root/zpool_wait/zpool_wait_trim_flag (expected SKIP)

@chrislongros
Copy link
Copy Markdown
Contributor Author

There are a couple lines in tests/test-runner/bin/zts-report.py.in which need to be deleted.

Tests with result of PASS that are unexpected:
    PASS cli_root/zpool_wait/zpool_wait_trim_basic (expected SKIP)
    PASS cli_root/zpool_wait/zpool_wait_trim_cancel (expected SKIP)
    PASS cli_root/zpool_wait/zpool_wait_trim_flag (expected SKIP)

Done :)

@behlendorf behlendorf added Status: Code Review Needed Ready for review and testing Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Apr 3, 2026
@behlendorf
Copy link
Copy Markdown
Contributor

@chrislongros one last rebase to resolve the new conflict and this is all set.

FreeBSD has supported hole punching via fspacectl(2) since
FreeBSD 14.0 and the test library already handles this using
truncate -d. Remove the skip that prevented trim tests from
running on FreeBSD.

Tests will still skip if the hardware does not support
TRIM/UNMAP, which is checked separately via diskinfo.

Signed-off-by: Christos Longros <chris.longros@gmail.com>
@github-actions github-actions bot removed the Status: Accepted Ready to integrate (reviewed, tested) label Apr 4, 2026
@amotin
Copy link
Copy Markdown
Member

amotin commented Apr 6, 2026

@chrislongros It seems few more tests need polishing. For example, see du: unrecognized option --block-size'`, but seems not only.

Replace GNU-specific du flags (--block-size, -B1) and dd conv=nocreat
with POSIX compatible commands. Move -O flag before pool name in
zpool create to align with FreeBSD's strict POSIX getopt(). Relax vdev
size thresholds to be applicable for ZFS-on-ZFS. Add sync_pool before
zpool trim -w to ensure freed blocks are committed before trimming.

Skip three tests (zpool_trim_partial, zpool_trim_verify_trimmed,
trim_config) on FreeBSD where manual zpool trim does not reclaim space
on file vdevs stored on a ZFS filesystem within the test framework.

Tested on FreeBSD 16.0-CURRENT: 26 PASS, 3 SKIP, 0 FAIL.

Signed-off-by: Christos Longros <chris.longros@gmail.com>
@chrislongros
Copy link
Copy Markdown
Contributor Author

chrislongros commented Apr 7, 2026

I converted the test commands to their POSIX analogues. I could not make the manual trim test to succeed no matter how many times I tried ... that's why I skipped it.
I also relaxed the VDEV_MAX_MB and VDEV_MIN_MB thresholds after many test replications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants