public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] syscalls/faccessat201: Add new testcase
Date: Tue, 22 Aug 2023 16:22:01 +0200	[thread overview]
Message-ID: <ZOTEiWZFdo3Kkhzs@yuki> (raw)
In-Reply-To: <1692700900-13521-1-git-send-email-xuyang2018.jy@fujitsu.com>

Hi!
Pushed with minor changes, thanks.

- we have to include config.h in the lapi/faccessat.h so that we get
  eventually get the macro HAVE_FACCESSAT2 definition (if defined)

- the directory in the test temporary directory must be 0777 otherwise
  the test will fail with EACCESS when executed as non-root

- the abs_path is initialized in the test setup dynamically, it
  shouldn't be initialized in the .bufs structure

Full diff:

diff --git a/include/lapi/faccessat.h b/include/lapi/faccessat.h
index 5b42014d2..05997d975 100644
--- a/include/lapi/faccessat.h
+++ b/include/lapi/faccessat.h
@@ -9,6 +9,7 @@
 #define FACCESSAT2_H

 #include "tst_test.h"
+#include "config.h"
 #include "lapi/syscalls.h"

 #ifndef HAVE_FACCESSAT2
diff --git a/testcases/kernel/syscalls/faccessat2/faccessat201.c b/testcases/kernel/syscalls/faccessat2/faccessat201.c
index 88ee21522..012091752 100644
--- a/testcases/kernel/syscalls/faccessat2/faccessat201.c
+++ b/testcases/kernel/syscalls/faccessat2/faccessat201.c
@@ -61,7 +61,7 @@ static void setup(void)
        abs_path = tst_aprintf("%s/%s", tmpdir_path, RELPATH);
        free(tmpdir_path);

-       SAFE_MKDIR(TESTDIR, 0666);
+       SAFE_MKDIR(TESTDIR, 0777);
        dir_fd = SAFE_OPEN(TESTDIR, O_DIRECTORY);
        SAFE_TOUCH(abs_path, 0444, NULL);
        SAFE_SYMLINK(abs_path, TESTSYMLINK);
@@ -80,7 +80,6 @@ static struct tst_test test = {
        .cleanup = cleanup,
        .bufs = (struct tst_buffers []) {
                {&testfile, .str = TESTFILE},
-               {&abs_path, .size = sizeof(char)},
                {&rel_path, .str = RELPATH},
                {&sym_path, .str = TESTSYMLINK},
                {},


-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      parent reply	other threads:[~2023-08-22 14:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 10:41 [LTP] [PATCH v2 1/2] syscalls/faccessat201: Add new testcase Yang Xu
2023-08-22 10:41 ` [LTP] [PATCH v2 2/2] syscalls/faccessat202: " Yang Xu
2023-08-22 14:59   ` Cyril Hrubis
2023-08-23  3:52     ` Yang Xu (Fujitsu)
2023-08-23  6:51       ` Cyril Hrubis
2023-08-22 14:22 ` Cyril Hrubis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOTEiWZFdo3Kkhzs@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox