From 1004e9123f76ce7ffd7a3a5a86cef3a620eac77c Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 24 Jan 2017 01:36:00 +0300 Subject: [PATCH] zdtm/socket_aio: add a synchonization between processes The test has to do nothing during c/r. ======================= Run zdtm/static/socket_aio in ns ======================= Start test ./socket_aio --pidfile=socket_aio.pid --outfile=socket_aio.out Run criu dump Run criu restore 5: Old maps lost: set(["7f0a5188a000-7f0a5188f000 ['rw-p']"]) 5: New maps appeared: set(["7f0a51884000-7f0a5188f000 ['rw-p']", "7f0a51883000-7f0a51884000 ['---p']"]) Send the 9 signal to 97 Wait for zdtm/static/socket_aio(97) to die for 0.100000 Reported-by: Mr Jenkins travis-ci: success for zdtm/socket_aio: add a synchonization between processes Signed-off-by: Andrei Vagin Signed-off-by: Pavel Emelyanov --- test/zdtm/static/socket_aio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/zdtm/static/socket_aio.c b/test/zdtm/static/socket_aio.c index 6ca5079b06..b8966b0238 100644 --- a/test/zdtm/static/socket_aio.c +++ b/test/zdtm/static/socket_aio.c @@ -32,9 +32,12 @@ int main(int argc, char **argv) pid_t pid; int ret, res; const struct aiocb *aioary[1]; + task_waiter_t child_waiter; test_init(argc, argv); + task_waiter_init(&child_waiter); + if ((fd_s = tcp_init_server(AF_INET, &port)) < 0) { pr_err("initializing server failed\n"); return 1; @@ -65,6 +68,8 @@ int main(int argc, char **argv) return 1; } + task_waiter_complete_current(&child_waiter); + /* Wait for request completion */ aioary[0] = &aiocb; ret = aio_error(&aiocb); @@ -109,6 +114,8 @@ int main(int argc, char **argv) goto error; } + task_waiter_wait4(&child_waiter, pid); + test_daemon(); test_waitsig();