[CRIU] [PATCH 3/3] zdtm: add test for new init reparent handling

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Feb 8 00:55:23 PST 2017


Before "rework init reparent handling" patch-set we would have got:

$ ./test/zdtm.py run -t zdtm/static/session01
=== Run 1/1 ================ zdtm/static/session01

======================= Run zdtm/static/session01 in ns ========================
Start test
./session01 --pidfile=session01.pid --outfile=session01.out
Run criu dump
Run criu restore
=[log]=> dump/zdtm/static/session01/37/1/restore.log
------------------------ grep Error ------------------------
(00.019813) Error (criu/pstree.c:724): Can't find a session leader for 21
------------------------ ERROR OVER ------------------------

as session 21(which is 2 or 20 in terms of testcases) was ripped in two,
and was not unreparented back by criu, so going up from it we can not
find it's leader.

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 test/zdtm/static/session01.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/test/zdtm/static/session01.c b/test/zdtm/static/session01.c
index 9bea83d..ca28cb0 100644
--- a/test/zdtm/static/session01.c
+++ b/test/zdtm/static/session01.c
@@ -53,10 +53,18 @@ static struct testcase __testcases[] = {
 	{10,  2, 10,  2, 10, 1 },  /*  |\_session00		*/
 	{11, 10, 11,  2, 11, 1 },  /*  |    \_session00		*/
 	{12, 11,  2,  2,  2, 1 },  /*  |        \_session00	*/
-	{13,  2,  2,  2,  2, 0 },  /*   \_session00		*/
+	{13,  2,  2,  2,  2, 0 },  /*  |\_session00		*/
+	{ 6,  2,  6,  2,  6, 0 },  /*  |\_session00		*/
+	{19,  2, 19,  2, 19, 0 },  /*   \_session00		*/
 	{ 3, 13,  2,  2,  2, 1 },  /* session00			*/
-	{ 6,  2,  6,  2,  6, 0 },  /*   \_session00		*/
 	{14,  6,  6,  6,  6, 1 },  /* session00			*/
+	{7,  19,  7,  2,  7, 1 },  /* session00			*/
+	{20,  7, 20,  2, 20, 1 },  /*   \_session00		*/
+	{21, 20, 21,  2, 21, 1 },  /*    |\_session00		*/
+	{22, 21,  2,  2,  2, 1 },  /*    |  \_session00		*/
+	{23, 20, 23, 20, 23, 0 },  /*     \_session00		*/
+	{24, 23, 24, 20, 24, 1 },  /* session00			*/
+	{25, 24, 20, 20, 20, 1 },  /*   \_session00		*/
 };
 
 #define TESTS (sizeof(__testcases) / sizeof(struct testcase))
-- 
2.9.3



More information about the CRIU mailing list