testsuite: add builtin test for modinfo

The modinfo command can show information about builtin modules. Make
sure that it functions correctly.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/136
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This commit is contained in:
Tobias Stoeckmann 2024-09-17 19:58:53 +02:00 committed by Lucas De Marchi
parent a49a96bdf0
commit fb2205805d
4 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,6 @@
name: intel_uncore
filename: (builtin)
license: GPL
file: arch/x86/events/intel/intel-uncore
description: Support for Intel uncore performance events
parm: uncore_no_discover:Don't enable the Intel uncore PerfMon discovery mechanism (default: enable the discovery mechanism). (bool)

View File

@ -109,4 +109,26 @@ DEFINE_TEST(test_modinfo_external,
.out = TESTSUITE_ROOTFS "test-modinfo/correct-external.txt",
})
static noreturn int test_modinfo_builtin(const struct test *t)
{
const char *const args[] = {
// clang-format off
progname,
"intel_uncore",
NULL,
// clang-format on
};
test_spawn_prog(progname, args);
exit(EXIT_FAILURE);
}
DEFINE_TEST(test_modinfo_builtin,
.description = "check if modinfo finds builtin module",
.config = {
[TC_ROOTFS] = TESTSUITE_ROOTFS "test-modinfo/builtin",
[TC_UNAME_R] = "6.11.0",
},
.output = {
.out = TESTSUITE_ROOTFS "test-modinfo/correct-builtin.txt",
})
TESTSUITE_MAIN();