From: Emil Velikov Date: Sat, 14 Sep 2024 14:08:59 +0000 (+0100) Subject: testsuite: remove access() sub-test X-Git-Tag: v34~341 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4928a9e61e91fe74ab99891184d9c211cd891e6d;p=thirdparty%2Fkmod.git testsuite: remove access() sub-test Our test does access + stat, where stat is sufficient. In addition, the kmod codebase never used access (afaict), so we're safe to remove the access() part. Alongside it we can drop the LD_PRELOAD wrapper. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/131 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/path.c b/testsuite/path.c index 9a7918c0..b251fc8a 100644 --- a/testsuite/path.c +++ b/testsuite/path.c @@ -185,7 +185,6 @@ WRAP_1ARG(int, -1, chdir); WRAP_2ARGS(FILE*, NULL, fopen, const char*); WRAP_2ARGS(int, -1, mkdir, mode_t); -WRAP_2ARGS(int, -1, access, int); WRAP_2ARGS(int, -1, stat, struct stat*); WRAP_OPEN(); diff --git a/testsuite/test-testsuite.c b/testsuite/test-testsuite.c index 9ef19cc4..dcfcf7c7 100644 --- a/testsuite/test-testsuite.c +++ b/testsuite/test-testsuite.c @@ -105,15 +105,10 @@ DEFINE_TEST(testsuite_rootfs_open, }, .need_spawn = true); -static int testsuite_rootfs_stat_access(const struct test *t) +static int testsuite_rootfs_stat(const struct test *t) { struct stat st; - if (access(MODULE_DIRECTORY "/a", F_OK) < 0) { - ERR("access failed: %m\n"); - return EXIT_FAILURE; - } - if (stat(MODULE_DIRECTORY "/a", &st) < 0) { ERR("stat failed: %m\n"); return EXIT_FAILURE; @@ -121,8 +116,8 @@ static int testsuite_rootfs_stat_access(const struct test *t) return EXIT_SUCCESS; } -DEFINE_TEST(testsuite_rootfs_stat_access, - .description = "test if rootfs works - stat() and access()", +DEFINE_TEST(testsuite_rootfs_stat, + .description = "test if rootfs works - stat()", .config = { [TC_ROOTFS] = TESTSUITE_ROOTFS "test-rootfs/", },