baremetal: exit at the end of main instead of infinite loop

run: interpret lkmc_test_fail as the last line of test as an error
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-08 22:00:03 +00:00
parent fc9e0c28a5
commit b1e16a59a1
8 changed files with 58 additions and 4 deletions

13
run
View File

@@ -392,11 +392,20 @@ def main(args, extra_args=None):
else:
panic_msg = b'Kernel panic - not syncing'
panic_re = re.compile(panic_msg)
error_string_found = False
with open(common.termout_file, 'br') as logfile:
for line in logfile:
if panic_re.search(line):
common.log_error('simulation error detected by parsing logs')
return 1
error_string_found = True
with open(common.guest_terminal_file, 'br') as logfile:
lines = logfile.readlines()
if lines:
last_line = lines[-1]
if last_line.rstrip() == common.magic_fail_string:
error_string_found = True
if error_string_found:
common.log_error('simulation error detected by parsing logs')
return 1
return 0
def get_argparse():