From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2] syscalls/pidfd_open: Continue with rest of the tests on failure
Date: Wed, 26 Feb 2020 22:08:18 +0800 [thread overview]
Message-ID: <5E567BD2.302@cn.fujitsu.com> (raw)
In-Reply-To: <2f579843fb1ff09cfaaa1b991b48437f525740b3.1582673499.git.viresh.kumar@linaro.org>
On 2020/2/26 7:33, Viresh Kumar wrote:
> With tst_brk(), the tests end immediately while what we want to do here
> is to test rest of the failure tests. Use tst_res() to report result and
> continue with rest of the failure tests.
>
> Signed-off-by: Viresh Kumar<viresh.kumar@linaro.org>
> ---
> V2: Use return, instead of if/else blocks.
>
> testcases/kernel/syscalls/pidfd_open/pidfd_open02.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c b/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> index d73b5326b3b1..9cdded13525a 100644
> --- a/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> +++ b/testcases/kernel/syscalls/pidfd_open/pidfd_open02.c
> @@ -35,14 +35,16 @@ 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);
> + return;
> }
>
> if (tc->exp_errno != TST_ERR) {
> - tst_brk(TFAIL | TTERRNO, "%s: pidfd_open() should fail with %s",
> + tst_res(TFAIL | TTERRNO, "%s: pidfd_open() should fail with %s",
> tc->name, tst_strerrno(tc->exp_errno));
> - }
> + return;
> + }
>
> tst_res(TPASS | TTERRNO, "%s: pidfd_open() failed as expected",
> tc->name);
Acked-by: Xiao Yang <ice_yangxiao@163.com>
next prev parent reply other threads:[~2020-02-26 14:08 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
2020-02-25 23:33 ` [LTP] [PATCH V2] " Viresh Kumar
2020-02-26 14:08 ` Xiao Yang [this message]
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=5E567BD2.302@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--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