sanitycheck: capture fails correctly on qemu crashes
We still have cases where qemu crashes are not being correctly captured in the on-screen summary, however they are captured in the final generated report. Fixes #26679 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
07fd28397e
commit
06052927be
1 changed files with 6 additions and 7 deletions
|
@ -840,8 +840,6 @@ class QEMUHandler(Handler):
|
||||||
timeout_time = time.time() + 30
|
timeout_time = time.time() + 30
|
||||||
else:
|
else:
|
||||||
timeout_time = time.time() + 2
|
timeout_time = time.time() + 2
|
||||||
else:
|
|
||||||
logger.debug("got nothing from harness")
|
|
||||||
line = ""
|
line = ""
|
||||||
|
|
||||||
handler.record(harness)
|
handler.record(harness)
|
||||||
|
@ -850,15 +848,17 @@ class QEMUHandler(Handler):
|
||||||
logger.debug("QEMU complete (%s) after %f seconds" %
|
logger.debug("QEMU complete (%s) after %f seconds" %
|
||||||
(out_state, handler_time))
|
(out_state, handler_time))
|
||||||
|
|
||||||
handler.set_state(out_state, handler_time)
|
|
||||||
|
|
||||||
if out_state == "timeout":
|
if out_state == "timeout":
|
||||||
handler.instance.reason = "Timeout"
|
handler.instance.reason = "Timeout"
|
||||||
|
handler.set_state("failed", handler_time)
|
||||||
elif out_state == "failed":
|
elif out_state == "failed":
|
||||||
handler.instance.reason = "Failed"
|
handler.instance.reason = "Failed"
|
||||||
elif out_state in ['unexpected eof', 'unexpected byte']:
|
|
||||||
handler.set_state("failed", handler_time)
|
handler.set_state("failed", handler_time)
|
||||||
|
elif out_state in ['unexpected eof', 'unexpected byte']:
|
||||||
handler.instance.reason = out_state
|
handler.instance.reason = out_state
|
||||||
|
handler.set_state("failed", handler_time)
|
||||||
|
else:
|
||||||
|
handler.set_state(out_state, handler_time)
|
||||||
|
|
||||||
log_out_fp.close()
|
log_out_fp.close()
|
||||||
out_fp.close()
|
out_fp.close()
|
||||||
|
@ -936,10 +936,9 @@ class QEMUHandler(Handler):
|
||||||
if os.path.exists(self.pid_fn):
|
if os.path.exists(self.pid_fn):
|
||||||
os.unlink(self.pid_fn)
|
os.unlink(self.pid_fn)
|
||||||
|
|
||||||
|
|
||||||
logger.debug(f"return code from qemu: {self.returncode}")
|
logger.debug(f"return code from qemu: {self.returncode}")
|
||||||
|
|
||||||
if self.returncode != 0:
|
if self.returncode != 0 or not harness.state:
|
||||||
self.set_state("failed", 0)
|
self.set_state("failed", 0)
|
||||||
self.instance.reason = "Exited with {}".format(self.returncode)
|
self.instance.reason = "Exited with {}".format(self.returncode)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue