From nobody Tue Nov 10 21:32:22 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jPKcQ59Lrz6xjbB for ; Tue, 10 Nov 2026 21:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jPKcQ4ZVRz4PZQ for ; Tue, 10 Nov 2026 21:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794346342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/6KVMogG2ibkRE6lQ299mzZkbhK6pSO0BduOsKZa6Xw=; b=i1JPXHgc87uZqznn3SHOCd5nnHwmsj3RO7E5WOGmhxLYWYzEl5adLVL4ObsCNbUasOWq6l hWY0a/l70ruLezc4cFQvoO860AvnNfOJhW5kavuvQEOxXep/Mnr1B5HLajXramiWR6QLSX uUrZXSBBFLrsgoDUB9WGCv7HcELKt6Wv2aDwf0ZTEtSzQp/JnGol/WCTOYay3rHg5iCAyb SzfmRUnJ46K7RCc9MPSDn9VuJUxcvlqEI/oUUk/o/LleN+GduMXRBw+OoqB0FGUgqPCQd4 mrnY32Vuoeqfl9dBKphziLhYL4qtt1tQxIkov+vnFwh5Lx+BOMQhVvZHLUaA4g== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794346342; b=rlPAx8yU3a4/66sS6T1z95KLNdAdjVuj9mAqrsCQVdE5GIly6bFG2B2pS7mhvJKjzsjEpB pcm2tfWa9zDOVF54hK6MClG1XWUi1pob7wAsG6H/9P8h+i/wITX6THQZ9LkfLi/G/IG3J7 APCa+0ugEdg2Z3FKPGrAGGk9vxh5DvVNKL+tIqRx8iOtVPrsrfSB3TAoTDLlOIV4pdGDbG xx5cMz2CwhUv4bM20acaDoxRKSF6YjomvLemsSsW6gzIyNJwwXqVqb8AlKcBbT1/O7Dv4z T2U5EALTUj4G97l1g6CPRo3i63gW7qHwnNHyuGzjb0aHZaJfR8qKO4t141KpFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794346342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/6KVMogG2ibkRE6lQ299mzZkbhK6pSO0BduOsKZa6Xw=; b=gtfIgPyI2Zh9eyISFNYVp+xUWXlUJpjFLZ/pF/k70LXgwfonhlvJbBvODhZxjxQ+rx1Gpp w57mm+60WPoGB/FK7YU5zZK9zOj8BsBYaiFN1HqVnuqb6l/OQg7eabKUZwlTr4NvShrKot lsLbkopiQU2vShQKxCJ3FUyPToBstkHMMlP+f1TXOEjrAk9gP5e9/oTR6gmhBOGshzpnfv gq+zo93E3l9iLfhHb3gw9/BvzgQeRGuj+T2QGCSXbREz9z5b0gg1jszIeHY6gJ3Ll8aZYx LB2wR8iNSMp3v81o2o/z/ZhbvXHYJq/I/Tc+ay05Y4wDFc/ziBvu9f61qc0b0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jPKcQ403CzmHJ for ; Tue, 10 Nov 2026 21:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id bcff by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Nov 2026 21:32:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: e34b159d4c64 - main - Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e34b159d4c64575aa45763968b6ad01dfd7c2337 Auto-Submitted: auto-generated Date: Tue, 10 Nov 2026 21:32:22 +0000 Message-Id: <6af38d66.bcff.2868ad23@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=e34b159d4c64575aa45763968b6ad01dfd7c2337 commit e34b159d4c64575aa45763968b6ad01dfd7c2337 Author: Enji Cooper AuthorDate: 2026-11-10 21:31:45 +0000 Commit: Enji Cooper CommitDate: 2026-11-10 21:31:54 +0000 Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros These macros predated the `require.kmod` (ATF) and `required_kmods` (kyua) test metadata and are no longer needed. Add a hint to freebsd_test_suite/macros.h about the `*FEATURE*` macros going away soon. See [this kyua issue][kyua-issue] for more details. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D61082 [kyua-issue]: https://github.com/freebsd/kyua/issues/346 --- contrib/netbsd-tests/kernel/t_mqueue.c | 4 ---- tests/freebsd_test_suite/macros.h | 26 +++++++++++++------------- tests/sys/kern/Makefile | 1 + tests/sys/net/routing/rtsock_config.h | 18 +++++++++++++++--- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/contrib/netbsd-tests/kernel/t_mqueue.c b/contrib/netbsd-tests/kernel/t_mqueue.c index 7edbbc9cc924..cde188efb67e 100644 --- a/contrib/netbsd-tests/kernel/t_mqueue.c +++ b/contrib/netbsd-tests/kernel/t_mqueue.c @@ -116,10 +116,6 @@ ATF_TC_BODY(mqueue, tc) char template[32]; char mq_name[64]; -#ifdef __FreeBSD__ - ATF_REQUIRE_KERNEL_MODULE("mqueuefs"); -#endif - strlcpy(template, "./t_mqueue.XXXXXX", sizeof(template)); tmpdir = mkdtemp(template); ATF_REQUIRE_MSG(tmpdir != NULL, "mkdtemp failed: %d", errno); diff --git a/tests/freebsd_test_suite/macros.h b/tests/freebsd_test_suite/macros.h index d09d7fe1bf05..975672f5be20 100644 --- a/tests/freebsd_test_suite/macros.h +++ b/tests/freebsd_test_suite/macros.h @@ -24,6 +24,11 @@ * SUCH DAMAGE. */ +/* + * TODO(ngie): replace these macros with first-class metadata properties via + * `atf` and `kyua`, much like `require.kmods`. + */ + #ifndef _FREEBSD_TEST_MACROS_H_ #define _FREEBSD_TEST_MACROS_H_ @@ -44,12 +49,10 @@ } \ } while(0) -#define ATF_REQUIRE_KERNEL_MODULE(_mod_name) do { \ - if (modfind(_mod_name) == -1) { \ - atf_tc_skip("module %s could not be resolved: %s", \ - _mod_name, strerror(errno)); \ - } \ -} while(0) +/* + * ATF_REQUIRE_KERNEL_MODULE was replaced by `require.kmods` (ATF property), + * et al. + */ #define ATF_REQUIRE_SYSCTL_BOOL(_mib_name, _required_value) do { \ bool value; \ @@ -83,12 +86,9 @@ } \ } while(0) -#define PLAIN_REQUIRE_KERNEL_MODULE(_mod_name, _exit_code) do { \ - if (modfind(_mod_name) == -1) { \ - printf("module %s could not be resolved: %s\n", \ - _mod_name, strerror(errno)); \ - _exit(_exit_code); \ - } \ -} while(0) +/* + * PLAIN_REQUIRE_KERNEL_MODULE was replaced by the `required_kmods` metadata + * property in Kyuafile. + */ #endif diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index a59168094c58..d34316a4b10e 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -137,6 +137,7 @@ NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt LIBADD.tty_pts+= util +TEST_METADATA.mqueue_test+= required_kmods="mqueuefs" ATF_TESTS_C+= libkern_crc32 SRCS.libkern_crc32+= libkern_crc32.c diff --git a/tests/sys/net/routing/rtsock_config.h b/tests/sys/net/routing/rtsock_config.h index 345fc13f167c..4b0925d7153b 100644 --- a/tests/sys/net/routing/rtsock_config.h +++ b/tests/sys/net/routing/rtsock_config.h @@ -127,9 +127,21 @@ config_setup(const atf_tc_t *tc, struct rtsock_config_options *co) ATF_CHECK_ERRNO(0, true); if (co->num_interfaces > 0) { - /* Try loading if_epair and if that fails skip the test. */ - kldload("if_epair"); - ATF_REQUIRE_KERNEL_MODULE("if_epair"); + /** + * Attempt to blindly load `if_epair`. If that fails (and + * `if_epair` isn't already loaded), fail the test via + * `atf_require_kmod(..)`. + * + * - TODO(igoro,ngie): `kyua prepare` support will clean this + * up a bit, but it requires plumbing on the kyua side, the + * CI side, and a few other areas. + * + * - TODO(ngie): replace this with `require.kmods` atf-c-api(3) + * property to restore prior behavior of skipping test + * instead of failing if `if_epair` is not loaded. + */ + (void)kldload("if_epair"); + atf_require_kmod("if_epair"); /* Clear errno for the following tests. */ errno = 0;