testsuite: add test to fail depmod on module loops

This commit is contained in:
Lucas De Marchi 2014-05-30 09:36:21 -03:00
parent a873f2350f
commit 8183cfa9da
7 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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,
};