diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-02-16 21:04:24 -0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-02-16 21:18:00 -0200 |
commit | a7f5300d50b7a45667322877132f7c321cd9ac35 (patch) | |
tree | de961415c5aa6835c7c7980da865a20504d64f99 | |
parent | f31d49c8b3a8ef863a6d6401b98b9e59a29ea53d (diff) | |
download | kmod-a7f5300d50b7a45667322877132f7c321cd9ac35.tar.gz |
testsuite: add test for builtins with modprobe
When user tries to load a module that is builtin in kernel, modprobe
should just return 0. This is not happening right now, so mark test as
expected_fail until it gets fixed.
-rw-r--r-- | testsuite/rootfs.tar.xz | bin | 661508 -> 661752 bytes | |||
-rw-r--r-- | testsuite/test-modprobe.c | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/testsuite/rootfs.tar.xz b/testsuite/rootfs.tar.xz Binary files differindex 08dbfc6..1ed83da 100644 --- a/testsuite/rootfs.tar.xz +++ b/testsuite/rootfs.tar.xz diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index 38d6c4c..0022c06 100644 --- a/testsuite/test-modprobe.c +++ b/testsuite/test-modprobe.c @@ -68,9 +68,31 @@ static DEFINE_TEST(modprobe_show_depends2, .output = { .stdout = TESTSUITE_ROOTFS "test-modprobe/show-depends/correct-psmouse.txt", }); + +static __noreturn int modprobe_builtin(const struct test *t) +{ + const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; + const char *const args[] = { + progname, + "unix", + NULL, + }; + + test_spawn_prog(progname, args); + exit(EXIT_FAILURE); +} +static DEFINE_TEST(modprobe_builtin, + .description = "check if modprobe return 0 for builtin", + .expected_fail = true, + .config = { + [TC_UNAME_R] = "4.4.4", + [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/builtin", + }); + static const struct test *tests[] = { &smodprobe_show_depends, &smodprobe_show_depends2, + &smodprobe_builtin, NULL, }; |