public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] Fix pidns14 test case
@ 2009-07-01 16:59 M. Mohan Kumar
  2009-07-01 18:20 ` Serge E. Hallyn
  0 siblings, 1 reply; 6+ messages in thread
From: M. Mohan Kumar @ 2009-07-01 16:59 UTC (permalink / raw)
  To: subrata; +Cc: ltp-list, sukadev, sachinp

[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

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] Fix pidns14 test case
  2009-07-01 16:59 [LTP] [PATCH] Fix pidns14 test case M. Mohan Kumar
@ 2009-07-01 18:20 ` Serge E. Hallyn
  2009-07-01 19:56   ` Sukadev Bhattiprolu
  0 siblings, 1 reply; 6+ messages in thread
From: Serge E. Hallyn @ 2009-07-01 18:20 UTC (permalink / raw)
  To: M. Mohan Kumar; +Cc: ltp-list, sukadev, sachinp

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] Fix pidns14 test case
  2009-07-01 18:20 ` Serge E. Hallyn
@ 2009-07-01 19:56   ` Sukadev Bhattiprolu
  2009-07-06 15:50     ` Subrata Modak
  0 siblings, 1 reply; 6+ messages in thread
From: Sukadev Bhattiprolu @ 2009-07-01 19:56 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: ltp-list, M. Mohan Kumar, sachinp

Serge E. Hallyn [serue@us.ibm.com] wrote:
| 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?

Yes we did confirm that there is a test for SIGKILL from parent ns.
We discussed in the bug report on whether to drop or modify the test,
but leaned towards modifying the test bc if SIGUSR1 does kill a container
init, then something has changed in the sig_ignored() checks in the kernel.

Hmm, not a very strong reason to keep the test.  Lets just drop the test :-)

Sukadev

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] Fix pidns14 test case
  2009-07-01 19:56   ` Sukadev Bhattiprolu
@ 2009-07-06 15:50     ` Subrata Modak
  2009-07-07 16:48       ` Sukadev Bhattiprolu
  0 siblings, 1 reply; 6+ messages in thread
From: Subrata Modak @ 2009-07-06 15:50 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: M. Mohan Kumar, sachinp, ltp-list

Suka,

So, what should i do finally ?? Drop this ?

Regards--
Subrata

On Wed, 2009-07-01 at 12:56 -0700, Sukadev Bhattiprolu wrote: 
> Serge E. Hallyn [serue@us.ibm.com] wrote:
> | 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?
> 
> Yes we did confirm that there is a test for SIGKILL from parent ns.
> We discussed in the bug report on whether to drop or modify the test,
> but leaned towards modifying the test bc if SIGUSR1 does kill a container
> init, then something has changed in the sig_ignored() checks in the kernel.
> 
> Hmm, not a very strong reason to keep the test.  Lets just drop the test :-)
> 
> Sukadev


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] Fix pidns14 test case
  2009-07-06 15:50     ` Subrata Modak
@ 2009-07-07 16:48       ` Sukadev Bhattiprolu
  2009-07-08 18:13         ` Subrata Modak
  0 siblings, 1 reply; 6+ messages in thread
From: Sukadev Bhattiprolu @ 2009-07-07 16:48 UTC (permalink / raw)
  To: Subrata Modak; +Cc: M. Mohan Kumar, sachinp, ltp-list

Subrata Modak [subrata@linux.vnet.ibm.com] wrote:
| Suka,
| 
| So, what should i do finally ?? Drop this ?

Yes, please.

Thanks,

Sukadev

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] Fix pidns14 test case
  2009-07-07 16:48       ` Sukadev Bhattiprolu
@ 2009-07-08 18:13         ` Subrata Modak
  0 siblings, 0 replies; 6+ messages in thread
From: Subrata Modak @ 2009-07-08 18:13 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: M. Mohan Kumar, sachinp, ltp-list

On Tue, 2009-07-07 at 09:48 -0700, Sukadev Bhattiprolu wrote: 
> Subrata Modak [subrata@linux.vnet.ibm.com] wrote:
> | Suka,
> | 
> | So, what should i do finally ?? Drop this ?
> 
> Yes, please.

Done. Thanks.

Regards--
Subrata

> 
> Thanks,
> 
> Sukadev


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-08 18:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 16:59 [LTP] [PATCH] Fix pidns14 test case M. Mohan Kumar
2009-07-01 18:20 ` Serge E. Hallyn
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox