SHA256
1
0
forked from pool/kmod
kmod/0005-testsuite-Add-test-for-modprobe-force.patch
Jan Engelhardt 237161f1b6 Accepting request 224726 from home:michal-m:branches:Base:System
- testsuite: Check the list of loaded modules after a test
- testsuite: Add test for modprobe --force
- testsuite: Do not provide finit_module(2) on older kernels
- Add some tests for kernels without finit_module(2)
- libkmod-module: Simplify kmod_module_insert_module()
- libkmod: Implement filtering of unsupported modules (fate#316971)
- modprobe: Implement --allow-unsupported-modules (fate#316971)
- make the %check section fatal

OBS-URL: https://build.opensuse.org/request/show/224726
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=65
2014-03-05 15:59:07 +00:00

60 lines
1.5 KiB
Diff

From 5b532fd9616ba2a750e25378152bad4c9a2e7c27 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Thu, 27 Feb 2014 22:34:24 +0100
Subject: [PATCH 05/10] testsuite: Add test for modprobe --force
There is no check if the correct flags are passed to finit_module, but
at least we cover the respective code path in kmod.
Patch-mainline: v17
Git-commit: 2ce5de0ae6c191920a4eeeab757ccfad092d9e0f
[mmarek: Dropped binary files from the patch]
---
testsuite/test-modprobe.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
index c3ef31e..92348b0 100644
--- a/testsuite/test-modprobe.c
+++ b/testsuite/test-modprobe.c
@@ -187,6 +187,28 @@ static DEFINE_TEST(modprobe_param_kcmdline,
.modules_loaded = "",
);
+static noreturn int modprobe_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_force,
+ .description = "check modprobe --force",
+ .config = {
+ [TC_UNAME_R] = "4.4.4",
+ [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/force",
+ [TC_INIT_MODULE_RETCODES] = "",
+ },
+ .modules_loaded = "psmouse",
+ );
+
static const struct test *tests[] = {
&smodprobe_show_depends,
@@ -196,6 +218,7 @@ static const struct test *tests[] = {
&smodprobe_softdep_loop,
&smodprobe_install_cmd_loop,
&smodprobe_param_kcmdline,
+ &smodprobe_force,
NULL,
};
--
1.8.4.5