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: 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: if os.path.exists(common.guest_terminal_file):
lines = logfile.readlines() with open(common.guest_terminal_file, 'br') as logfile:
if lines: lines = logfile.readlines()
last_line = lines[-1] if lines:
if last_line.rstrip() == common.magic_fail_string: last_line = lines[-1]
error_string_found = True if last_line.rstrip() == common.magic_fail_string:
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

View File

@@ -228,7 +228,7 @@ the script is a .py file next to the source code.
''' '''
) )
parser.add_argument( parser.add_argument(
'--userland', default=defaults['userland'], '-u', '--userland', default=defaults['userland'],
) )
parser.add_argument( parser.add_argument(
'break_at', nargs='?', 'break_at', nargs='?',