From: Lucas De Marchi Date: Thu, 16 Feb 2012 23:04:24 +0000 (-0200) Subject: testsuite: add test for builtins with modprobe X-Git-Tag: v6~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7f5300d50b7a45667322877132f7c321cd9ac35;p=thirdparty%2Fkmod.git 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. --- diff --git a/testsuite/rootfs.tar.xz b/testsuite/rootfs.tar.xz index 08dbfc6f..1ed83daf 100644 Binary files a/testsuite/rootfs.tar.xz and b/testsuite/rootfs.tar.xz differ diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c index 38d6c4c4..0022c06a 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, };