Page MenuHomeFreeBSD

newfs_msdos: fix type of kern.maxphys; connect ATF test from NetBSD
ClosedPublic

Authored by vangyzen on Jan 31 2022, 8:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 6:22 PM
Unknown Object (File)
Mar 10 2024, 6:22 PM
Unknown Object (File)
Mar 10 2024, 6:22 PM
Unknown Object (File)
Mar 7 2024, 8:44 PM
Unknown Object (File)
Feb 10 2024, 12:51 AM
Unknown Object (File)
Feb 6 2024, 8:12 AM
Unknown Object (File)
Jan 2 2024, 12:57 PM
Unknown Object (File)
Jan 2 2024, 12:57 PM
Subscribers

Details

Summary

The type of the kern.maxphys sysctl OID is now ulong. Change the
local variable type to match.

NetBSD has an ATF test for newfs_msdos. Connect it to the build.
Adapt it for FreeBSD. This would have caught this bug.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbin/newfs_msdos/mkfs_msdos.c
845

This file will be a separate commit.

LGTM
I think the way we handle contrib NetBSD tests is strange but that's beyond the scope of this change

This revision is now accepted and ready to land.Jan 31 2022, 8:50 PM

This could also be handled in the Makefile to avoid having to dance around FreeBSD vs NetBSD in the test, since I assume we'll never upstream the utility name item and will always deviate from NetBSD.

Examples in use:

bin/expr/tests/Makefile:ATF_TESTS_SH_SED_expr_test+=    -e 's/eval expr/eval expr --/g'
bin/expr/tests/Makefile:ATF_TESTS_SH_SED_expr_test+=    -e 's/"expr: integer overflow or underflow occurred for operation.*"/"expr: overflow"/g'
usr.bin/diff/tests/Makefile:ATF_TESTS_SH_SED_netbsd_diff_test+= -e 's/t_diff/`basename $$0`/g'
usr.bin/sed/tests/Makefile:ATF_TESTS_SH_SED_sed_test+=  -e 's,atf_expect_fail "PR bin/28126",,g'
In D34116#771685, @ngie wrote:

This could also be handled in the Makefile to avoid having to dance around FreeBSD vs NetBSD in the test, since I assume we'll never upstream the utility name item and will always deviate from NetBSD.

Please no, we used to have lots of cases of applying patches at build time etc. and it results in obfuscation and awkwardness. It made some sense in the CVS days when there was a cost to bringing a file off the vendor branch but we're much better served by using contemporary source management tools to manage it for us.