From 9a23dec3269fad1c4f03f6b9b4ceccedc136d4e2 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Thu, 27 Feb 2014 23:33:38 +0100 Subject: [PATCH 07/10] Add some tests for kernels without finit_module(2) Patch-mainline: v17 Git-commit: be29c40e25b71d35708b9fad5772ebcd8e4685b3 [mmarek: Dropped binary files from the patch] --- testsuite/test-modprobe.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index 92348b0..b675f48 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -209,6 +209,50 @@ static DEFINE_TEST(modprobe_force, .modules_loaded = "psmouse", ); +static noreturn int modprobe_oldkernel(const struct test *t) +{ + const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; + const char *const args[] = { + progname, + "psmouse", + NULL, + }; + + test_spawn_prog(progname, args); + exit(EXIT_FAILURE); +} +static DEFINE_TEST(modprobe_oldkernel, + .description = "check modprobe --force", + .config = { + [TC_UNAME_R] = "3.3.3", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/oldkernel", + [TC_INIT_MODULE_RETCODES] = "", + }, + .modules_loaded = "psmouse", + ); + +static noreturn int modprobe_oldkernel_force(const struct test *t) +{ + const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; + const char *const args[] = { + progname, + "--force", "psmouse", + NULL, + }; + + test_spawn_prog(progname, args); + exit(EXIT_FAILURE); +} +static DEFINE_TEST(modprobe_oldkernel_force, + .description = "check modprobe --force", + .config = { + [TC_UNAME_R] = "3.3.3", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/oldkernel-force", + [TC_INIT_MODULE_RETCODES] = "", + }, + .modules_loaded = "psmouse", + ); + static const struct test *tests[] = { &smodprobe_show_depends, @@ -219,6 +263,8 @@ static const struct test *tests[] = { &smodprobe_install_cmd_loop, &smodprobe_param_kcmdline, &smodprobe_force, + &smodprobe_oldkernel, + &smodprobe_oldkernel_force, NULL, }; -- 1.8.4.5