From 4ea3acb03c801428f119cb8768fe39d4dd22012a Mon Sep 17 00:00:00 2001 From: Andrew Vagin Date: Sat, 9 Jan 2016 22:57:00 +0300 Subject: [PATCH] zdtm/session00: wait when a child closes fd 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 Signed-off-by: Pavel Emelyanov --- 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 1cae1f522..a7a0c28c3 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]);