run: fix error log parsing

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-13 00:00:02 +00:00
parent 238f1ad1c0
commit 425fb26736

4
run
View File

@@ -398,13 +398,13 @@ def main(args, extra_args=None):
with open(common.termout_file, 'br') as logfile: with open(common.termout_file, 'br') as logfile:
for line in logfile: for line in logfile:
if panic_re.search(line): if panic_re.search(line):
error_string_found = true error_string_found = True
with open(common.guest_terminal_file, 'br') as logfile: with open(common.guest_terminal_file, 'br') as logfile:
lines = logfile.readlines() lines = logfile.readlines()
if lines: if lines:
last_line = lines[-1] last_line = lines[-1]
if last_line.rstrip() == common.magic_fail_string: if last_line.rstrip() == common.magic_fail_string:
error_string_found = true error_string_found = True
if error_string_found: if error_string_found:
common.log_error('simulation error detected by parsing logs') common.log_error('simulation error detected by parsing logs')
return 1 return 1