common.run_cmd: assert result == 0 by default

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-10-23 00:00:01 +00:00
parent 4cd9c533b8
commit 4b99e522dd
12 changed files with 81 additions and 74 deletions

7
run
View File

@@ -118,7 +118,7 @@ def main(args, extra_args=None):
# This is to run gem5 from a prebuilt download.
if (not args.baremetal is None) or (not os.path.exists(common.linux_image)):
raise_image_not_found()
assert common.run_cmd([os.path.join(common.extract_vmlinux, common.linux_image)]) == 0
common.run_cmd([os.path.join(common.extract_vmlinux, common.linux_image)])
os.makedirs(os.path.dirname(common.gem5_readfile), exist_ok=True)
with open(common.gem5_readfile, 'w') as readfile:
readfile.write(args.gem5_readfile)
@@ -313,10 +313,7 @@ def main(args, extra_args=None):
out_file = None
else:
out_file = common.termout_file
returncode = common.run_cmd(cmd, cmd_file=common.run_cmd_file, out_file=out_file, extra_env=extra_env)
if returncode != 0:
common.log_error('simulator exited with status != 0')
return returncode
common.run_cmd(cmd, cmd_file=common.run_cmd_file, out_file=out_file, extra_env=extra_env)
# Check if guest panicked.
if args.gem5:
# We have to do some parsing here because gem5 exits with status 0 even when panic happens.