Commit 7edbcdac authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

zdtm/mountpoints: wait when a child process opens descriptors

Otherwise we can see this error:
5: Old files lost: set([])
5: New files appeared: set(['5', '6'])

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 64d31150
...@@ -27,6 +27,8 @@ struct ns_exec_args { ...@@ -27,6 +27,8 @@ struct ns_exec_args {
int status_pipe[2]; int status_pipe[2];
}; };
task_waiter_t t;
int ns_child(void *_arg) int ns_child(void *_arg)
{ {
struct stat st; struct stat st;
...@@ -52,6 +54,8 @@ int ns_child(void *_arg) ...@@ -52,6 +54,8 @@ int ns_child(void *_arg)
pid = fork(); pid = fork();
task_waiter_complete(&t, 1);
test_waitsig(); test_waitsig();
if (pid) { if (pid) {
...@@ -80,6 +84,8 @@ int main(int argc, char **argv) ...@@ -80,6 +84,8 @@ int main(int argc, char **argv)
test_init(argc, argv); test_init(argc, argv);
task_waiter_init(&t);
again: again:
fs_cnt = 0; fs_cnt = 0;
f = fopen("/proc/self/mountinfo", "r"); f = fopen("/proc/self/mountinfo", "r");
...@@ -277,6 +283,8 @@ done: ...@@ -277,6 +283,8 @@ done:
} }
} }
task_waiter_wait4(&t, 1);
test_daemon(); test_daemon();
test_waitsig(); test_waitsig();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment