Commit cf3b0e51 authored by Petr Špaček's avatar Petr Špaček

Merge branch 'exit_code_check' into 'master'

Fail on non-zero exit code from tested subprocess

See merge request !12
parents c8f5952b 73c47678
......@@ -251,17 +251,20 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
server.start_srv((rd.address, 53), socket.AF_INET6)
# Play test scenario
ex = None
try:
server.play(CHILD_IFACE)
if VERBOSE:
print(open('%s/server.log' % TMPDIR).read())
except:
print(open('%s/server.log' % TMPDIR).read())
except Exception as ex:
raise
finally:
server.stop()
daemon_proc.terminate()
daemon_proc.wait()
if VERBOSE or ex or daemon_proc.returncode:
print(open('%s/server.log' % TMPDIR).read())
if daemon_proc.returncode != 0:
raise ValueError('process terminated with return code %s'
% daemon_proc.returncode)
# Do not clear files if the server crashed (for analysis)
del_files(TMPDIR, OWN_TMPDIR)
......
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