]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: remove access() sub-test
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 14 Sep 2024 14:08:59 +0000 (15:08 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 17 Sep 2024 03:01:34 +0000 (22:01 -0500)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/131
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/path.c
testsuite/test-testsuite.c

index 9a7918c065780f5eae2678d1b0d0216668f1aa54..b251fc8ad40db92045a5fc2a845b0b895f5bb221 100644 (file)
@@ -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();
index 9ef19cc4ca6e2b2fb87ad67a95e29544bc4af357..dcfcf7c77956c78118b3e52ca08df17d5d4d4609 100644 (file)
@@ -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/",
        },