[CRIU] [PATCH] zdtm/session00: wait when a child closes fd

Andrey Vagin avagin at openvz.org
Sat Jan 9 11:57:18 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

A static test should not change its state during C/R

===================== Run zdtm/live/static/session00 in ns =====================
Start test
./session00 --pidfile=session00.pid --outfile=session00.out
Run criu dump
Run criu restore
7: Old files lost: set(['4'])
7: New files appeared: set([])
############# Test zdtm/live/static/session00 FAIL at fds compare ##############

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm/live/static/session00.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/zdtm/live/static/session00.c b/test/zdtm/live/static/session00.c
index 1cae1f5..a7a0c28 100644
--- a/test/zdtm/live/static/session00.c
+++ b/test/zdtm/live/static/session00.c
@@ -151,6 +151,12 @@ child:
 		pr_perror("read failed");
 		return 1;
 	}
+	/* wait when a child closes fd */
+	ret = read(p[0], &testcases[i].pid, sizeof(pid));
+	if (ret != 0)) {
+		pr_perror("read failed");
+		return 1;
+	}
 
 	close(p[0]);
 
-- 
2.4.3



More information about the CRIU mailing list