git: 74898ce961e1 - main - tests/sndstat: use require.kmods property instead of ad-hoc checks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Sep 2025 18:42:31 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=74898ce961e1f4818eba500dfa3a06bc30c1d9b3 commit 74898ce961e1f4818eba500dfa3a06bc30c1d9b3 Author: Siva Mahadevan <me@svmhdvn.name> AuthorDate: 2025-07-21 13:25:26 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-09-05 18:42:22 +0000 tests/sndstat: use require.kmods property instead of ad-hoc checks Signed-off-by: Siva Mahadevan <me@svmhdvn.name> Sponsored by: The FreeBSD Foundation Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1780 --- tests/sys/sound/sndstat.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c index ed292b570429..bbf18aca2824 100644 --- a/tests/sys/sound/sndstat.c +++ b/tests/sys/sound/sndstat.c @@ -40,17 +40,11 @@ #include <stdlib.h> #include <unistd.h> -static void -load_dummy(void) -{ - if (kldload("snd_dummy.ko") < 0 && errno != EEXIST) - atf_tc_skip("snd_dummy.ko not found"); -} - ATF_TC(sndstat_nv); ATF_TC_HEAD(sndstat_nv, tc) { atf_tc_set_md_var(tc, "descr", "/dev/sndstat nvlist test"); + atf_tc_set_md_var(tc, "require.kmods", "snd_dummy"); } ATF_TC_BODY(sndstat_nv, tc) @@ -62,8 +56,6 @@ ATF_TC_BODY(sndstat_nv, tc) size_t nitems, nchans, i, j; int fd, rc, pchan, rchan; - load_dummy(); - if ((fd = open("/dev/sndstat", O_RDONLY)) < 0) atf_tc_skip("/dev/sndstat not found, load sound(4)"); @@ -223,6 +215,7 @@ ATF_TC(sndstat_udev); ATF_TC_HEAD(sndstat_udev, tc) { atf_tc_set_md_var(tc, "descr", "/dev/sndstat userdev interface test"); + atf_tc_set_md_var(tc, "require.kmods", "snd_dummy"); } ATF_TC_BODY(sndstat_udev, tc) @@ -234,8 +227,6 @@ ATF_TC_BODY(sndstat_udev, tc) size_t nitems, i; int fd, rc, pchan, rchan, n; - load_dummy(); - if ((fd = open("/dev/sndstat", O_RDWR)) < 0) atf_tc_skip("/dev/sndstat not found, load sound(4)");