diff options
author | Joe Lawrence <joe.lawrence@redhat.com> | 2019-01-09 07:43:29 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2019-01-11 14:51:24 -0500 |
commit | a2818ee4dce575b299d8a7f46b393bc2b02ef1f4 (patch) | |
tree | 0f616177ebf9e8d2f00023f8db89a89374e65c94 /lib/livepatch/test_klp_callbacks_mod.c | |
parent | d67a53720966f2ef5be5c8f238d13512b8260868 (diff) |
selftests/livepatch: introduce tests
Add a few livepatch modules and simple target modules that the included
regression suite can run tests against:
- basic livepatching (multiple patches, atomic replace)
- pre/post (un)patch callbacks
- shadow variable API
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Tested-by: Miroslav Benes <mbenes@suse.cz>
Tested-by: Alice Ferrazzi <alice.ferrazzi@gmail.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'lib/livepatch/test_klp_callbacks_mod.c')
-rw-r--r-- | lib/livepatch/test_klp_callbacks_mod.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/livepatch/test_klp_callbacks_mod.c b/lib/livepatch/test_klp_callbacks_mod.c new file mode 100644 index 000000000000..8fbe645b1c2c --- /dev/null +++ b/lib/livepatch/test_klp_callbacks_mod.c | |||
@@ -0,0 +1,24 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | // Copyright (C) 2018 Joe Lawrence <joe.lawrence@redhat.com> | ||
3 | |||
4 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
5 | |||
6 | #include <linux/module.h> | ||
7 | #include <linux/kernel.h> | ||
8 | |||
9 | static int test_klp_callbacks_mod_init(void) | ||
10 | { | ||
11 | pr_info("%s\n", __func__); | ||
12 | return 0; | ||
13 | } | ||
14 | |||
15 | static void test_klp_callbacks_mod_exit(void) | ||
16 | { | ||
17 | pr_info("%s\n", __func__); | ||
18 | } | ||
19 | |||
20 | module_init(test_klp_callbacks_mod_init); | ||
21 | module_exit(test_klp_callbacks_mod_exit); | ||
22 | MODULE_LICENSE("GPL"); | ||
23 | MODULE_AUTHOR("Joe Lawrence <joe.lawrence@redhat.com>"); | ||
24 | MODULE_DESCRIPTION("Livepatch test: target module"); | ||