From nobody Tue Nov 10 22:13:55 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 4jPLXM6llYz6xmYf for ; Tue, 10 Nov 2026 22:13:55 +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 4jPLXM4btsz4TtW for ; Tue, 10 Nov 2026 22:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794348835; 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=it2tnDQdEt9CYQZGbg50g6MNKIlmVAz7LQEHfRF9Jsw=; b=N9s4T7BFQU+RqXuE8MXg+gFCoLQBt9hGq+E2ASMY5AZKw0F3MZ8ZrsRoeUa7FNbi4IGuCW inqxZXvkjpgV3GZCmjltuQvRXFhns1HSeZf2+1U+KcOEuPFtZT7HXBXF2bcfRmXp/bcFx4 jFtvWxIs4am/aULs6hhLbOmf6Y0PLThIF9Ey82SMZ2ErD77HnaQmsudWlbFtRJRC+elcN7 15eZ9hf5iQ4w0ueL6pAuo1xjaWEb5mUpcfunBrvb0JbwFncxbQ+0VFkxzaDWmT5/JaSPhD RydDptVNpWEHtAGhOCOg9w4zRvtL+vFhRZl8jAue81+NDq6u+U5PBGN7z62m0A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794348835; b=BXI1raNzD87C0OsEWD1S512Nb798biPFOzJB/3PKQDUVr8DUvKoq8gEXXjx23vKbN4OGXv yRKdvSc2fRQRVzPurjGmcaglKeAnNr/U1rydC/uWwy0vOHklpNA4V4PYMVSFNqpqmKEujf vW9Ok/oWXPukU8xi7gQkfJHv6mO1y8Q75OG21GXxaqVjeUGYN5jbkjs2XHVCc4BzRqRxxZ /vVoby9OL3W5FSOFFmi40Is/hRBIK+oz2/HkVsy1T9uwTohaHAXAqZTB4h/mxb9eJD0oPW C0wgU0f+E88veRCbhIOLQS/6orfP5Vm5FtqihaYnD5gno3kST+Z0nMg4ppm5VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794348835; 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=it2tnDQdEt9CYQZGbg50g6MNKIlmVAz7LQEHfRF9Jsw=; b=NUVKyYxE59OYdICpP9q4+TZBUbWqpE/axCeBaKFEwF+Pn7TIIC/yyuAAzeulpHpBo+audy DJ8Kg/ZJVqaprvfOZ6ppzJ8vwrGTwBYpqv3wYD92AXtKZbe8SCoCsyy+fbsZc8k4IxYReR 9q1ZxeLZBefl6E6Kq1WhmxXOvL3qvIF6kw1W3gp0KRtIoYAuU3QyXAUjHoiPA0wU3X41xr hFtYzlxFYcIqs2gbK7M92Hb/V2nGOOHmxDPmlAmzNW+aHWB1UbkHWMhVqzX2gnhiz9CXmi MYOLY3qIPcl3BiiW+4k1G78/X7WeyduoreQ9wvGH7ntZxDCI8CUCeHr/bd38Fw== 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 4jPLXM4GhKzndL for ; Tue, 10 Nov 2026 22:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id ece3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Nov 2026 22:13:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 307e725acce2 - main - Revert "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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 307e725acce22043d5961b0ad392ea0283e1d056 Auto-Submitted: auto-generated Date: Tue, 10 Nov 2026 22:13:55 +0000 Message-Id: <6af39723.ece3.3f0e8925@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=307e725acce22043d5961b0ad392ea0283e1d056 commit 307e725acce22043d5961b0ad392ea0283e1d056 Author: Mark Johnston AuthorDate: 2026-11-10 22:12:50 +0000 Commit: Mark Johnston CommitDate: 2026-11-10 22:12:50 +0000 Revert "Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros" The change breaks the build of tests/sys/net/routing/test_rtsock_l3.c. This reverts commit e34b159d4c64575aa45763968b6ad01dfd7c2337. --- 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, 20 insertions(+), 29 deletions(-) diff --git a/contrib/netbsd-tests/kernel/t_mqueue.c b/contrib/netbsd-tests/kernel/t_mqueue.c index cde188efb67e..7edbbc9cc924 100644 --- a/contrib/netbsd-tests/kernel/t_mqueue.c +++ b/contrib/netbsd-tests/kernel/t_mqueue.c @@ -116,6 +116,10 @@ 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 975672f5be20..d09d7fe1bf05 100644 --- a/tests/freebsd_test_suite/macros.h +++ b/tests/freebsd_test_suite/macros.h @@ -24,11 +24,6 @@ * 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_ @@ -49,10 +44,12 @@ } \ } while(0) -/* - * ATF_REQUIRE_KERNEL_MODULE was replaced by `require.kmods` (ATF property), - * et al. - */ +#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) #define ATF_REQUIRE_SYSCTL_BOOL(_mib_name, _required_value) do { \ bool value; \ @@ -86,9 +83,12 @@ } \ } while(0) -/* - * PLAIN_REQUIRE_KERNEL_MODULE was replaced by the `required_kmods` metadata - * property in Kyuafile. - */ +#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) #endif diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index d34316a4b10e..a59168094c58 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -137,7 +137,6 @@ 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 4b0925d7153b..345fc13f167c 100644 --- a/tests/sys/net/routing/rtsock_config.h +++ b/tests/sys/net/routing/rtsock_config.h @@ -127,21 +127,9 @@ config_setup(const atf_tc_t *tc, struct rtsock_config_options *co) ATF_CHECK_ERRNO(0, true); if (co->num_interfaces > 0) { - /** - * 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"); + /* Try loading if_epair and if that fails skip the test. */ + kldload("if_epair"); + ATF_REQUIRE_KERNEL_MODULE("if_epair"); /* Clear errno for the following tests. */ errno = 0;