[EMAIL PROTECTED] wrote:
Veerendra [EMAIL PROTECTED] wrote:
Hi

 Please find the testcase for the below assertion.

<begin>
Assertions 1:
Steps:
a) Create a  container .
b) Create many levels of child containers inside this container.
c) Now do kill -9 init , outside of the contaier.
d) This should kill all the child containers . (containers created at
the level below )
<end>

This information could be in the patch description below. The rest
could be just in the email and stripped out from patch.

Submitting the modified changes as Sukadev suggested.
This new patch contains ,
modified description and
for loop, to avoids extra 'if condition '


Thanks
Veerendra C


Index: root/new/ltp-full-20080930/testcases/kernel/containers/pidns/pidns05.c
===================================================================
--- root.orig/new/ltp-full-20080930/testcases/kernel/containers/pidns/pidns05.c
+++ root/new/ltp-full-20080930/testcases/kernel/containers/pidns/pidns05.c
@@ -14,11 +14,14 @@
 *
 ***************************************************************************
 *
-* Description:
-*  This testcase creates 5 nested containers.
-*  And it will destroy a container, and verifies that the child
-*  containers are also destroyed when the parent container is killed.
+* Assertion:
+*   a) Create a  container.
+*   b) Create many levels of child containers inside this container.
+*   c) Now do kill -9 init , outside of the container.
+*   d) This should kill all the child containers.
+*      (containers created at the level below)
 *
+* Description:
 * 1. Parent process clone a process with flag CLONE_NEWPID
 * 2. The container will recursively loop and creates 4 more containers.
 * 3. All the container init's  goes into sleep(), waiting to be terminated.
@@ -95,14 +98,10 @@ int find_cinit_pids(pid_t *pids)
 	parentpid = getpid();
 	pgid = getpgid(parentpid);
 
-	/* To wrap around if the pid has reached the max_pid */
-	if (parentpid != pid_max)
-		i = parentpid + 1;
-	else
-		i = 2;
-
 	/* The loop breaks, when the loop counter reaches the parentpid value */
-	while (i != parentpid) {
+	for (i = parentpid + 1; i != parentpid; i++) {
+		if (i > pid_max)
+			i = 2;
 		sprintf(proc_file, "/proc/%d/stat", i);
 		fp = fopen(proc_file, "r");
 
@@ -118,10 +117,6 @@ int find_cinit_pids(pid_t *pids)
 			}
 			fclose(fp);
 		}
-		if (i == pid_max)
-			i = 2;
-		else
-			i++;
 	}
 	return next;
 }
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to