git: c14281f6bb46 - main - tests/sys/kern: skip unix_connectat fdescfs cases when fdescfs is missing

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Thu, 24 Sep 2026 16:04:36 UTC
The branch main has been updated by olivier:

URL: https://cgit.FreeBSD.org/src/commit/?id=c14281f6bb462ca03383d92a0d88228e9426268e

commit c14281f6bb462ca03383d92a0d88228e9426268e
Author:     Nick Banks <nickbanks@netflix.com>
AuthorDate: 2026-09-24 15:49:09 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2026-09-24 16:00:44 +0000

    tests/sys/kern: skip unix_connectat fdescfs cases when fdescfs is missing
    
    unix_connectat's fdescfs cases call mount_fdescfs(), which skipped on ENODEV.
    nmount(2) never returns ENODEV: vfs_donmount() remaps the ENODEV from a failed
    fdescfs module load to EINVAL with errmsg "Invalid fstype", so the skip never
    fired and the cases failed on kernels without fdescfs.
    
    Approved by:    ngie, asomers
    Sponsored by:   Netflix
    Differential Revision:  https://reviews.freebsd.org/D59227
---
 tests/sys/kern/unix_connectat.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/sys/kern/unix_connectat.c b/tests/sys/kern/unix_connectat.c
index 04885ee464ee..12832b30c76b 100644
--- a/tests/sys/kern/unix_connectat.c
+++ b/tests/sys/kern/unix_connectat.c
@@ -128,7 +128,6 @@ pathconnect(int fd, int s, const char *path)
  * rather than relying on the host's /dev/fd keeps the fdescfs cases
  * self-contained: they exercise real fdescfs lookups regardless of how the
  * host is set up, and the mode-specific behaviour below is then well defined.
- * Skips if the kernel has no fdescfs.
  */
 static void
 mount_fdescfs(const char * const *opts)
@@ -154,8 +153,6 @@ mount_fdescfs(const char * const *opts)
 
 	errmsg[0] = '\0';
 	error = nmount(iov, iovlen, 0);
-	if (error != 0 && errno == ENODEV)
-		atf_tc_skip("no fdescfs support in the kernel");
 	ATF_REQUIRE_MSG(error == 0, "mount fdescfs on %s: %s", FDDIR,
 	    errmsg[0] != '\0' ? errmsg : strerror(errno));
 
@@ -183,6 +180,7 @@ fdpath(char *buf, size_t len, int fd)
 	ATF_TC_HEAD(name, tc)						\
 	{								\
 		atf_tc_set_md_var(tc, "require.user", "root");		\
+		atf_tc_set_md_var(tc, "require.kmods", "fdescfs");	\
 	}								\
 	ATF_TC_CLEANUP(name, tc)					\
 	{								\