diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2014-05-30 09:36:21 -0300 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2014-05-30 09:36:56 -0300 |
commit | 8183cfa9dac9216e4f50b2fb33a22ae0eac233e9 (patch) | |
tree | c2794646febaa405493d295211c2305f3b245d02 | |
parent | a873f2350f15a7803780f473257dc2467df0a229 (diff) | |
download | kmod-8183cfa9dac9216e4f50b2fb33a22ae0eac233e9.tar.gz kmod-8183cfa9dac9216e4f50b2fb33a22ae0eac233e9.tar.bz2 kmod-8183cfa9dac9216e4f50b2fb33a22ae0eac233e9.zip |
testsuite: add test to fail depmod on module loops
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleA.ko | bin | 0 -> 4713 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleB.ko | bin | 0 -> 4713 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleC.ko | bin | 0 -> 4713 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleD.ko | bin | 0 -> 4713 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleE.ko | bin | 0 -> 4713 bytes | |||
-rw-r--r-- | testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/modules.order | 5 | ||||
-rw-r--r-- | testsuite/test-depmod.c | 23 |
7 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleA.ko b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleA.ko Binary files differnew file mode 100644 index 0000000..c48a418 --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleA.ko diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleB.ko b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleB.ko Binary files differnew file mode 100644 index 0000000..70dc122 --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleB.ko diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleC.ko b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleC.ko Binary files differnew file mode 100644 index 0000000..ded3201 --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleC.ko diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleD.ko b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleD.ko Binary files differnew file mode 100644 index 0000000..2c7273a --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleD.ko diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleE.ko b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleE.ko Binary files differnew file mode 100644 index 0000000..393e825 --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/kernel/moduleE.ko diff --git a/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/modules.order b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/modules.order new file mode 100644 index 0000000..718a50e --- /dev/null +++ b/testsuite/rootfs-pristine/test-depmod/detect-loop/lib/modules/4.4.4/modules.order @@ -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 diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c index 5b67348..c5caec4 100644 --- a/testsuite/test-depmod.c +++ b/testsuite/test-depmod.c @@ -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, }; |