Commit caeb8db5 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

zdtm:mntns_open: wait when a child process opens descriptors

Reported-by: Mr Jenkins
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7edbcdac
......@@ -58,6 +58,8 @@ static int get_mntid(int fd)
return mnt_id;
}
task_waiter_t t;
int ns_child(void *_arg)
{
struct ns_exec_args *args = _arg;
......@@ -65,6 +67,7 @@ int ns_child(void *_arg)
int id1, id2;
fd2 = open(fpath, O_RDWR);
task_waiter_complete(&t, 1);
test_waitsig();
id1 = get_mntid(args->fd);
......@@ -87,6 +90,8 @@ int main(int argc, char **argv)
test_init(argc, argv);
task_waiter_init(&t);
snprintf(fpath, sizeof(fpath), "%s/%s", dirname, MPTS_FILE);
if (mkdir(dirname, 0600) < 0) {
fail("Can't make zdtm_sys");
......@@ -109,10 +114,11 @@ int main(int argc, char **argv)
close(args.fd);
}
task_waiter_wait4(&t, 1);
test_daemon();
test_waitsig();
if (pid > 0) {
kill(pid, SIGTERM);
int status = 1;
......
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