From: Cyril Hrubis <chrubis@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3] syscalls/faccessat202: Add new testcase
Date: Wed, 23 Aug 2023 11:34:43 +0200 [thread overview]
Message-ID: <ZOXSs_mwxB_9kn23@yuki> (raw)
In-Reply-To: <1692768242-5649-1-git-send-email-xuyang2018.jy@fujitsu.com>
Hi!
I've added short descriptions to the testcase structure and pushed,
thanks.
Full diff:
diff --git a/testcases/kernel/syscalls/faccessat2/faccessat202.c b/testcases/kernel/syscalls/faccessat2/faccessat202.c
index e6cd1ec5e..a60db2bf8 100644
--- a/testcases/kernel/syscalls/faccessat2/faccessat202.c
+++ b/testcases/kernel/syscalls/faccessat2/faccessat202.c
@@ -46,13 +46,15 @@ static struct tcase {
int mode;
int flags;
int exp_errno;
+ const char *desc;
} tcases[] = {
- {&atcwd_fd, &bad_path, R_OK, 0, EFAULT},
- {&atcwd_fd, &rel_path, R_OK, -1, EINVAL},
- {&atcwd_fd, &rel_path, -1, 0, EINVAL},
- {&bad_fd, &rel_path, R_OK, 0, EBADF},
- {&fd, &rel_path, R_OK, 0, ENOTDIR},
- {&atcwd_fd, &rel_path, R_OK, AT_EACCESS, EACCES},
+ {&atcwd_fd, &bad_path, R_OK, 0, EFAULT, "invalid address"},
+ {&atcwd_fd, &rel_path, R_OK, -1, EINVAL, "invalid flags"},
+ {&atcwd_fd, &rel_path, -1, 0, EINVAL, "invalid mode"},
+ {&bad_fd, &rel_path, R_OK, 0, EBADF, "invalid fd"},
+ {&fd, &rel_path, R_OK, 0, ENOTDIR, "fd pointing to file"},
+ {&atcwd_fd, &rel_path, R_OK, AT_EACCESS, EACCES,
+ "AT_EACCESS and unprivileged EUID"},
};
static void verify_faccessat2(unsigned int i)
@@ -63,7 +65,7 @@ static void verify_faccessat2(unsigned int i)
SAFE_SETEUID(ltpuser->pw_uid);
TST_EXP_FAIL(faccessat2(*tc->fd, *tc->filename, tc->mode, tc->flags),
- tc->exp_errno, "faccessat2()");
+ tc->exp_errno, "faccessat2() with %s", tc->desc);
if (tc->exp_errno == EACCES)
SAFE_SETEUID(0);
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2023-08-23 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 5:24 [LTP] [PATCH v3] syscalls/faccessat202: Add new testcase Yang Xu
2023-08-23 9:34 ` 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=ZOXSs_mwxB_9kn23@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