run: dont break on userland due to missing termout file

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-15 00:00:02 +00:00
parent f8631e58d0
commit 95c1800b0e
2 changed files with 8 additions and 7 deletions

13
run
View File

@@ -399,12 +399,13 @@ def main(args, extra_args=None):
for line in logfile:
if panic_re.search(line):
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 os.path.exists(common.guest_terminal_file):
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