summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/netbsd-tests/rump/modautoload/t_modautoload.c')
-rw-r--r--contrib/netbsd-tests/rump/modautoload/t_modautoload.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/contrib/netbsd-tests/rump/modautoload/t_modautoload.c b/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
index f28ad55..2c21a90 100644
--- a/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
+++ b/contrib/netbsd-tests/rump/modautoload/t_modautoload.c
@@ -1,4 +1,4 @@
-/* $NetBSD: t_modautoload.c,v 1.2 2014/03/10 22:38:53 pooka Exp $ */
+/* $NetBSD: t_modautoload.c,v 1.5 2016/09/14 03:19:11 ozaki-r Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -33,6 +33,9 @@ ATF_TC_HEAD(modautoload, tc)
static void
mountkernfs(void)
{
+ bool old_autoload, new_autoload;
+ size_t old_len, new_len;
+ int error;
if (!rump_nativeabi_p())
atf_tc_skip("host kernel modules not supported");
@@ -41,6 +44,16 @@ mountkernfs(void)
if (rump_sys_mkdir("/kern", 0777) == -1)
atf_tc_fail_errno("mkdir /kern");
+
+ new_autoload = true;
+ old_len = sizeof(old_autoload);
+ new_len = sizeof(new_autoload);
+ error = sysctlbyname("kern.module.autoload",
+ &old_autoload, &old_len,
+ &new_autoload, new_len);
+ if (error != 0)
+ atf_tc_fail_errno("could not enable module autoload");
+
if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)
atf_tc_fail_errno("could not mount kernfs");
}
OpenPOWER on IntegriCloud