From 6c47be48532abaf53c09831fbedf65fc35d6564f Mon Sep 17 00:00:00 2001 From: asomers Date: Mon, 1 Oct 2018 15:45:20 +0000 Subject: [PATCH] MFC r336594: Fix tmpfs detection in the sys/fs/tmpfs tests This code was originally written for NetBSD. r306031 tried to adapt it to FreeBSD, but didn't correctly handle the case that tmpfs was available, but not already loaded. Fix the logic to load the module if necessary. The tmpfs tests shouldn't be skipped anymore. Also, fix a comment that was dislocated by r306031. Reported by: Jenkins --- contrib/netbsd-tests/fs/h_funcs.subr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/netbsd-tests/fs/h_funcs.subr b/contrib/netbsd-tests/fs/h_funcs.subr index 21bdd97163e..dc4403f4aa1 100644 --- a/contrib/netbsd-tests/fs/h_funcs.subr +++ b/contrib/netbsd-tests/fs/h_funcs.subr @@ -43,17 +43,17 @@ require_fs() { atf_require_prog mount_${name} atf_require_prog umount - # if we have autoloadable modules, just assume the file system - atf_require_prog sysctl # Begin FreeBSD if true; then - if kldstat -m ${name}; then + if kldload -n ${name}; then found=yes else found=no fi else # End FreeBSD + # if we have autoloadable modules, just assume the file system + atf_require_prog sysctl autoload=$(sysctl -n kern.module.autoload) [ "${autoload}" = "1" ] && return 0 -- 2.45.2