testsuite: add test for builtins with modprobe
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Thu, 16 Feb 2012 23:04:24 +0000 (21:04 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Thu, 16 Feb 2012 23:18:00 +0000 (21:18 -0200)
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.

testsuite/rootfs.tar.xz
testsuite/test-modprobe.c

index 08dbfc6..1ed83da 100644 (file)
Binary files a/testsuite/rootfs.tar.xz and b/testsuite/rootfs.tar.xz differ
index 38d6c4c..0022c06 100644 (file)
@@ -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,
 };