Commit 43d78feb authored by Pavel Emelyanov's avatar Pavel Emelyanov

zdtm: Fix exit code propagation from failed tests

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 50ad633a
...@@ -740,6 +740,7 @@ def list_tests(opts): ...@@ -740,6 +740,7 @@ def list_tests(opts):
if os.environ.has_key('CR_CT_TEST_INFO'): if os.environ.has_key('CR_CT_TEST_INFO'):
# Fork here, since we're new pidns init and are supposed to # Fork here, since we're new pidns init and are supposed to
# collect this namespace's zombies # collect this namespace's zombies
status = 0
pid = os.fork() pid = os.fork()
if pid == 0: if pid == 0:
tinfo = eval(os.environ['CR_CT_TEST_INFO']) tinfo = eval(os.environ['CR_CT_TEST_INFO'])
...@@ -748,9 +749,11 @@ if os.environ.has_key('CR_CT_TEST_INFO'): ...@@ -748,9 +749,11 @@ if os.environ.has_key('CR_CT_TEST_INFO'):
while True: while True:
wpid, status = os.wait() wpid, status = os.wait()
if wpid == pid: if wpid == pid:
if not os.WIFEXITED(status) or os.WEXITSTATUS(status) != 0:
status = 1
break; break;
sys.exit(0) sys.exit(status)
p = argparse.ArgumentParser("CRIU test suite") p = argparse.ArgumentParser("CRIU test suite")
p.add_argument("--debug", help = "Print what's being executed", action = 'store_true') p.add_argument("--debug", help = "Print what's being executed", action = 'store_true')
......
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