From 1359eeb2493aad5a5c971b7b4ed0efc9f1260caa Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 21 Nov 2024 17:53:47 +0000 Subject: [PATCH] testsuite/test-weakdep: remove custom handling Currently test-weakdep is the only test which explicitly sets the kernel module lookup directory and the modprobe.d location. It does so by explicitly hard-coding the full path for both, thus effectively bypassing the path handling done in our `LD_PRELOAD` module `path.so`. Just use `kmod_new(NULL, NULL);` which will ensure that everything is handled relatively to `TC_ROOTFS` defined further down in the test. Note: this technically reduces our test coverage, although kmod_new() is not the goal of this test and should be handled separately. Noticed while removing the TESTSUITE_ROOTFS instances from DEFINE_TEST() Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/258 Signed-off-by: Lucas De Marchi --- testsuite/test-weakdep.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/testsuite/test-weakdep.c b/testsuite/test-weakdep.c index ca75349a..fdde0b2b 100644 --- a/testsuite/test-weakdep.c +++ b/testsuite/test-weakdep.c @@ -15,14 +15,6 @@ #include "testsuite.h" -#define TEST_WEAKDEP_ROOTFS TESTSUITE_ROOTFS "test-weakdep/" -#define TEST_WEAKDEP_KERNEL_DIR TEST_WEAKDEP_ROOTFS MODULE_DIRECTORY "/4.4.4/" - -static const char *const test_weakdep_config_paths[] = { - TEST_WEAKDEP_ROOTFS SYSCONFDIR "/modprobe.d", - NULL, -}; - static const char *const mod_name[] = { "mod-loop-b", "mod-weakdep", @@ -35,7 +27,7 @@ static int test_weakdep(const struct test *t) int mod_name_index = 0; int err; - ctx = kmod_new(TEST_WEAKDEP_KERNEL_DIR, test_weakdep_config_paths); + ctx = kmod_new(NULL, NULL); if (ctx == NULL) exit(EXIT_FAILURE);