Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Refactor pidns32 test using new LTP API
Date: Mon, 15 Aug 2022 16:49:41 +0200	[thread overview]
Message-ID: <YvpdBVnJGs6OVKag@yuki> (raw)
In-Reply-To: <20220811113640.8499-1-andrea.cervesato@suse.com>

Hi!
Pushed with one fix, thanks.

I moved the *nested = 1 from setup to the run() function, otherwise the
test would be no-op on second and subsequent iterations with -i option.

Diff:

diff --git a/testcases/kernel/containers/pidns/pidns32.c b/testcases/kernel/cont
index cbc91df68..333e1fcad 100644
--- a/testcases/kernel/containers/pidns/pidns32.c
+++ b/testcases/kernel/containers/pidns/pidns32.c
@@ -43,13 +43,14 @@ static int child_func(LTP_ATTRIBUTE_UNUSED void *arg)
 static void setup(void)
 {
        level = SAFE_MMAP(NULL, sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED
-       *level = 1;
 }

 static void run(void)
 {
        int ret, status;

+       *level = 1;
+
        ret = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_func, 0);
        if (ret < 0)
                tst_brk(TBROK | TERRNO, "clone failed");


-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2022-08-15 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 11:36 [LTP] [PATCH v1] Refactor pidns32 test using new LTP API Andrea Cervesato via ltp
2022-08-15 14:49 ` Cyril Hrubis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-08-10  9:48 Andrea Cervesato via ltp
2022-08-10 14:06 ` 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=YvpdBVnJGs6OVKag@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.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