From: "Serge E. Hallyn" <serue@us.ibm.com>
To: "M. Mohan Kumar" <mohan@in.ibm.com>
Cc: ltp-list@lists.sf.net, sukadev@linux.vnet.ibm.com, sachinp@in.ibm.com
Subject: Re: [LTP] [PATCH] Fix pidns14 test case
Date: Wed, 1 Jul 2009 13:20:05 -0500 [thread overview]
Message-ID: <20090701182005.GC17998@us.ibm.com> (raw)
In-Reply-To: <20090701165923.GC3237@in.ibm.com>
Quoting M. Mohan Kumar (mohan@in.ibm.com):
> [PATCH] pidns14
>
> Container-init may be immune to unhandled fatal signals (like SIGUSR1)
> even if they are from ancestor namespace. SIGKILL/SIGSTOP are the only
> reliable signals to a container-init from ancestor namespace. Make sure
> that container-init will not respond to signals other than
> SIGKILL/SIGSTOP
Hmm? This may or may not be right... but you start out by saying 'may be
immune to', then provide a patch making the testcase TFAIL if is not immune
to. So at the very least anyone on a slightly older kernel will get TFAILs.
I don't think that immunity to SIGUSR1 from ancestor pidns is something we
want to guarantee, it's just what is happening. The proper thing is to
not depend on either getting or not getting SIGUSR1, in my opinion. Suka?
-serge
> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
> ---
> testcases/kernel/containers/pidns/pidns14.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/testcases/kernel/containers/pidns/pidns14.c b/testcases/kernel/containers/pidns/pidns14.c
> index e95bf95..41602cd 100644
> --- a/testcases/kernel/containers/pidns/pidns14.c
> +++ b/testcases/kernel/containers/pidns/pidns14.c
> @@ -67,9 +67,8 @@ int child_fn(void *ttype)
> tst_resm(TBROK, "pidns is not created.");
> cleanup();
> }
> - pause();
> - tst_resm(TFAIL, "Oops! Container init resumed after receiving SIGUSR1");
> - return -1;
> + sleep(10);
> + return 0;
> }
>
> /*
> @@ -111,9 +110,11 @@ int main(int argc, char *argv[])
> if (waitpid(cpid, &status, 0) < 0)
> tst_resm(TWARN, "waitpid() failed.");
>
> - if ((WIFSIGNALED(status)) && (WTERMSIG(status) == SIGUSR1))
> - tst_resm(TPASS, "Container init is killed as expected, "
> - " when the SIGUSR1 is passed from parent\n");
> + if (WIFEXITED(status))
> + tst_resm(TPASS, "Container init returned as expected\n");
> + else if ((WIFSIGNALED(status)) && (WTERMSIG(status) == SIGUSR1))
> + tst_resm(TFAIL, "Container init is killed when the SIGUSR1 "
> + "is passed from parent\n");
> else
> tst_resm(TFAIL, "After sending signal kill -USR1, "
> "returned unexpected error\n");
> --
> 1.6.0.2
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2009-07-03 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 16:59 [LTP] [PATCH] Fix pidns14 test case M. Mohan Kumar
2009-07-01 18:20 ` Serge E. Hallyn [this message]
2009-07-01 19:56 ` Sukadev Bhattiprolu
2009-07-06 15:50 ` Subrata Modak
2009-07-07 16:48 ` Sukadev Bhattiprolu
2009-07-08 18:13 ` Subrata Modak
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=20090701182005.GC17998@us.ibm.com \
--to=serue@us.ibm.com \
--cc=ltp-list@lists.sf.net \
--cc=mohan@in.ibm.com \
--cc=sachinp@in.ibm.com \
--cc=sukadev@linux.vnet.ibm.com \
/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