Skip to content

Commit

Permalink
zdtm/socket_aio: add a synchonization between processes
Browse files Browse the repository at this point in the history
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 <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  • Loading branch information
avagin authored and xemul committed Jan 25, 2017
1 parent 0dea86c commit 1004e91
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/zdtm/static/socket_aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -109,6 +114,8 @@ int main(int argc, char **argv)
goto error;
}

task_waiter_wait4(&child_waiter, pid);

test_daemon();
test_waitsig();

Expand Down

0 comments on commit 1004e91

Please sign in to comment.