mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-12-18 04:27:03 +07:00
testsuite: add test to fail depmod on module loops
This commit is contained in:
parent
a873f2350f
commit
8183cfa9da
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
kernel//home/lucas/p/kmod/testsuite/module-playground/moduleA.ko
|
||||
kernel//home/lucas/p/kmod/testsuite/module-playground/moduleB.ko
|
||||
kernel//home/lucas/p/kmod/testsuite/module-playground/moduleC.ko
|
||||
kernel//home/lucas/p/kmod/testsuite/module-playground/moduleD.ko
|
||||
kernel//home/lucas/p/kmod/testsuite/module-playground/moduleE.ko
|
@ -106,6 +106,28 @@ static DEFINE_TEST(depmod_search_order_same_prefix,
|
||||
},
|
||||
});
|
||||
|
||||
#define DETECT_LOOP_ROOTFS TESTSUITE_ROOTFS "test-depmod/detect-loop"
|
||||
static noreturn int depmod_detect_loop(const struct test *t)
|
||||
{
|
||||
const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
|
||||
const char *const args[] = {
|
||||
progname,
|
||||
NULL,
|
||||
};
|
||||
|
||||
test_spawn_prog(progname, args);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
static DEFINE_TEST(depmod_detect_loop,
|
||||
.description = "check if depmod detects module loops correctly",
|
||||
.config = {
|
||||
[TC_UNAME_R] = "4.4.4",
|
||||
[TC_ROOTFS] = DETECT_LOOP_ROOTFS,
|
||||
},
|
||||
.expected_fail = true,
|
||||
);
|
||||
|
||||
|
||||
|
||||
static const struct test *tests[] = {
|
||||
#ifdef ENABLE_ZLIB
|
||||
@ -113,6 +135,7 @@ static const struct test *tests[] = {
|
||||
#endif
|
||||
&sdepmod_search_order_simple,
|
||||
&sdepmod_search_order_same_prefix,
|
||||
&sdepmod_detect_loop,
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user