From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Rewrite waitid01.c test using new LTP API
Date: Tue, 22 Feb 2022 15:49:12 +0100 [thread overview]
Message-ID: <YhT36IYLmEPM2jNB@yuki> (raw)
In-Reply-To: <20220222143549.3286-1-andrea.cervesato@suse.de>
Hi!
> + TST_EXP_PASS(waitid(P_ALL, getpid(), infop, WEXITED));
> + TST_EXP_EQ_LI(infop->si_pid, pidchild);
> + TST_EXP_EQ_LI(infop->si_status, 123);
> + TST_EXP_EQ_LI(infop->si_signo, SIGCHLD);
> + TST_EXP_EQ_LI(infop->si_code, CLD_EXITED);
> }
Looks good, but we should add the two different cases as well.
The one that kills the child with SIGHUP should have si_code set to
CLD_KILLED and and the si_status should be SIGHUP. And the 'division by
zero' case is supposed to have it set to CLD_DUMPED. I think that we
should add these two tests as well.
Also looking at man pages the idtype can be set to P_PIDFD since 5.4 as
well, so we should add a waitid test with a pidfd too.
> +static struct tst_test test = {
> + .test_all = run,
> + .forks_child = 1,
> + .bufs =
> + (struct tst_buffers[]){
> + { &infop, .size = sizeof(*infop) },
> + {},
> + },
> +};
> --
> 2.35.1
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2022-02-22 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 14:35 [LTP] [PATCH v1] Rewrite waitid01.c test using new LTP API Andrea Cervesato
2022-02-22 14:49 ` 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=YhT36IYLmEPM2jNB@yuki \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.de \
--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