Commit 0cc62891 authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm.py: Auto-reap all ns children

When test is run in pseudo-container (--parallel execution) the new namespace's
init is the python script itself. Thus all dying tests get reparent-ed to it and
sit as zombies forever.

Create pseudo-init for such containers ripping all the children.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9841778f
......@@ -531,8 +531,18 @@ def list_tests(opts, tlist):
#
if os.environ.has_key('ZDTM_CT_TEST_INFO'):
tinfo = eval(os.environ['ZDTM_CT_TEST_INFO'])
do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
# Fork here, since we're new pidns init and are supposed to
# collect this namespace's zombies
pid = os.fork()
if pid == 0:
tinfo = eval(os.environ['ZDTM_CT_TEST_INFO'])
do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3])
else:
while True:
wpid, status = os.wait()
if wpid == pid:
break;
sys.exit(0)
p = argparse.ArgumentParser("ZDTM test suite")
......
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