From nobody Thu Nov 19 23:48:03 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 4jVwBq338nz71dKy for ; Thu, 19 Nov 2026 23:48:03 +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 4jVwBq2KdBz4Ls2 for ; Thu, 19 Nov 2026 23:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795132083; 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=Hsi6ejUOrKcO6L1qv/eONfZFqdKW6vf8a5nK6Yo5JM0=; b=XwFnuvKDLPtcwC4kXirjBsD0c4Be9OYdbwJbujaFg05UNPxwlKJX2gjixGC9p00bmuvNah bFF3xLYWvF3jbLp0PwlTuQu1FEw3xoGU/yvFBxhi6jKzuMqdiC+jKU6zCT7T0YaF0mkFFy lCwLGb+PQkN6k89Fel5N2+DQ2jg68IgFLvC5Cp6Yjz7dFgAGmYPjYREo+1ZJ5Vb5R3KTdd dyx42n8WmZGuuuswx88SFGsUPEBMPjlR+vGVx26LFxMMjajY7mArNd6K8VEFPE4eLH1bhn 0Bo74OI7BNKdMkErbamVlMRTgdpStfDHAr4GAkPrmd62894RQoDniAip5NlAWg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795132083; b=NVbhQr3ytzZP7djL6mH4AEeir26QXkW+iYoy9ZgxaAO9iDKdZmHvJXTKyf/sfxkVpeiegb B/v6DmYb4Lrd2o05QvwKHfS1QnmgP8vW8K6d+O2zc+STQfXKMyUF37k6mV2qyrSPURiUAx UenYv2djMSxCcOkjKy/RZXRcxJqGObSKaTXghWQyBwseF+7KHD3yTp9HxD6sESlA5WII0P qapgmAu4aWLB21pScOuoq7T8bH/4NcXYqGD8INYiLBHR4eZl8sBTVg2Oeq/l0zuCo15mEe d0BhwpsGBAuXgQgsSeuygqcVEv0PI/Ixd8zV3yxFS+8k9yakmoqeET0CUFZ6Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795132083; 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=Hsi6ejUOrKcO6L1qv/eONfZFqdKW6vf8a5nK6Yo5JM0=; b=VfmH1+qFzW/VkXGekcVI9e2WTDqmH1PISmeq4mYhSTbUl/+fNJFSytD94VRiilyQjtuxiF sVA7UQPJiY+TZzfkZql6tg+s7hX4rTI7MhO84vWQt5ouaOU22W7iIrKF2xQ/7u1DrGmtCo bd/ByZb6iDyLr2j/jAWetEFL2XjYwS2FAELjq/cXU4HeAk2KrR90EpUheUCMX6nrcfmP3Z 2uJ0ekNAZZ08gHIW+G+ZUUJwSrXBhgDjkoCpLXd3z5VsoX4lifTtFpXDgbmxM+sPL1BwVx smFqL0A70Otbjh5JP8DXMclXs1oNNo4W8Jluf/lP83C/s0/p70GD9k1nNXxeag== 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 4jVwBq1zMCzMtZ for ; Thu, 19 Nov 2026 23:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f69b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 19 Nov 2026 23:48:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: f992c0819019 - 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: f992c0819019c20196800dbb8a40cb6910d8b9f5 Auto-Submitted: auto-generated Date: Thu, 19 Nov 2026 23:48:03 +0000 Message-Id: <6aff8ab3.1f69b.3f87b68a@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=f992c0819019c20196800dbb8a40cb6910d8b9f5 commit f992c0819019c20196800dbb8a40cb6910d8b9f5 Author: Enji Cooper AuthorDate: 2026-11-10 21:31:45 +0000 Commit: Enji Cooper CommitDate: 2026-11-19 23:47:46 +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 0a8615fad24e..95f07157f108 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -140,6 +140,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..ecea1abd43a3 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_tc_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_tc_require_kmod("if_epair"); /* Clear errno for the following tests. */ errno = 0;