t_create.sh: use ATF_TESTS_SH_SED & remove local mods

This particular change replaces all local modifications to the test
script like so:
- Use `ATF_TESTS_SH_SED_test` with a sed(1) statement in the Makefile,
  instead of the equivalent local modifications.
- Remove the need for expecting the output of newfs_msdos to be empty.
  There isn't much to gain from deviating from the upstream NetBSD test--it's
  just another local modification that would need to be carried forward. If
  it's worth testing this FreeBSD-specific behavior, it should be in a
  FreeBSD-specific test.

This makes moving new modifications to the script easier moving forward.

MFC after:	1 week
This commit is contained in:
Enji Cooper
2026-02-15 10:26:52 -08:00
parent caf23c8e0b
commit 411a566d56
2 changed files with 4 additions and 12 deletions
@@ -31,21 +31,11 @@ validfat32_head() {
} }
validfat32_body() { validfat32_body() {
if true; then atf_check -s eq:0 -o ignore -e ignore \
# FreeBSD
exp_err=empty
fsck=fsck_msdosfs
else
# NetBSD
exp_err=ignore
fsck=fsck_msdos
fi
atf_check -s eq:0 -o ignore -e $exp_err \
newfs_msdos -b 512 -C 33m -F 32 msdos.img newfs_msdos -b 512 -C 33m -F 32 msdos.img
# fsck_msdos/newfs_msdos have been fixed # fsck_msdos/newfs_msdos have been fixed
# atf_expect_fail "PR bin/46743" # atf_expect_fail "PR bin/46743"
atf_check -s eq:0 -o not-match:FIXED -e empty $fsck -p msdos.img atf_check -s eq:0 -o not-match:FIXED -e empty fsck_msdos -p msdos.img
atf_expect_pass atf_expect_pass
} }
+2
View File
@@ -2,5 +2,7 @@ TESTSRC=${SRCTOP}/contrib/netbsd-tests/sbin/newfs_msdos
NETBSD_ATF_TESTS_SH+= create NETBSD_ATF_TESTS_SH+= create
ATF_TESTS_SH_SED_create= -e 's/fsck_msdos/fsck_msdosfs/'
.include <netbsd-tests.test.mk> .include <netbsd-tests.test.mk>
.include <bsd.test.mk> .include <bsd.test.mk>