public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] pidns05: Use tst_getpid()
Date: Mon, 25 Sep 2023 15:12:35 +0200	[thread overview]
Message-ID: <20230925131235.GB60471@pevik> (raw)
In-Reply-To: <ZQ2E_pKz2QSG61LY@yuki>

Hi all,

> Hi!
> > --- a/testcases/kernel/containers/pidns/pidns05.c
> > +++ b/testcases/kernel/containers/pidns/pidns05.c
> > @@ -28,7 +28,7 @@ static void child_func(int *level)
> >  {
> >  	pid_t cpid, ppid;

> > -	cpid = getpid();
> > +	cpid = tst_getpid();
> >  	ppid = getppid();

> >  	TST_EXP_EQ_LI(cpid, 1);
> > @@ -55,7 +55,7 @@ static int find_cinit_pids(pid_t *pids)
> >  	int next = 0;
> >  	pid_t parentpid, pgid, pgid2;

> > -	parentpid = getpid();
> > +	parentpid = tst_getpid();

> I suppose that this one is not strictly required, but it does not harm
> to consistently use tst_getpid()

Well, Martin found that some of SLES versions (e.g. some SLES versions based on
kernel 4.12 or older) started to fail after rewrite:

8c201e55f ("Remove libclone dependency from pidns05 test")

tst_test.c:1684: TINFO: LTP version: 20230516
tst_test.c:1570: TINFO: Timeout per run is 0h 00m 30s
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:34: TFAIL: cpid (2075) != 1 (1)
pidns05.c:35: TPASS: ppid == 0 (0)
pidns05.c:97: TPASS: find_cinit_pids(pids) returned 6
pidns05.c:115: TPASS: No children left after sending SIGKILL to the first child

Therefore it was needed.

Kind regards,
Petr

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

  reply	other threads:[~2023-09-25 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 15:31 [LTP] [PATCH] pidns05: Use tst_getpid() Martin Doucha
2023-09-20 15:37 ` Petr Vorel
2023-09-22 12:13 ` Cyril Hrubis
2023-09-25 13:12   ` Petr Vorel [this message]
2023-09-25 13:17     ` Cyril Hrubis
2023-09-25 17:45       ` Petr Vorel

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=20230925131235.GB60471@pevik \
    --to=pvorel@suse.cz \
    --cc=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