From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/pidfd_open: Continue with rest of the tests on failure
Date: Tue, 25 Feb 2020 13:19:14 +0100 [thread overview]
Message-ID: <20200225121914.GC5077@rei.lan> (raw)
In-Reply-To: <54a3d6fcef8cfed89a1e4f0b56717f56aa502293.1582611994.git.viresh.kumar@linaro.org>
Hi!
Agree here, also tst_brk(TFAIL, ...) is not working well at this point, see:
https://github.com/linux-test-project/ltp/issues/462
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> .../kernel/syscalls/pidfd_open/pidfd_open02.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c b/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> index d73b5326b3b1..533270da3dbd 100644
> --- a/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> +++ b/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> @@ -35,17 +35,15 @@ static void run(unsigned int n)
>
> if (TST_RET != -1) {
> SAFE_CLOSE(TST_RET);
> - tst_brk(TFAIL, "%s: pidfd_open succeeded unexpectedly (index: %d)",
> + tst_res(TFAIL, "%s: pidfd_open succeeded unexpectedly (index: %d)",
> tc->name, n);
> - }
> -
> - if (tc->exp_errno != TST_ERR) {
> - tst_brk(TFAIL | TTERRNO, "%s: pidfd_open() should fail with %s",
> + } else if (tc->exp_errno != TST_ERR) {
> + tst_res(TFAIL | TTERRNO, "%s: pidfd_open() should fail with %s",
> tc->name, tst_strerrno(tc->exp_errno));
> - }
Can we please use return instead of the else if branches?
i.e.
if (...) {
tst_res(TFAIL, ...);
return;
}
> - tst_res(TPASS | TTERRNO, "%s: pidfd_open() failed as expected",
> - tc->name);
> + } else {
> + tst_res(TPASS | TTERRNO, "%s: pidfd_open() failed as expected",
> + tc->name);
> + }
> }
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-02-25 12:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 6:26 [LTP] [PATCH] syscalls/pidfd_open: Continue with rest of the tests on failure Viresh Kumar
2020-02-25 12:19 ` Cyril Hrubis [this message]
2020-02-25 23:33 ` [LTP] [PATCH V2] " Viresh Kumar
2020-02-26 14:08 ` Xiao Yang
2020-02-26 16:23 ` Cyril Hrubis
2020-02-26 16:21 ` Cyril Hrubis
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=20200225121914.GC5077@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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