mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
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:
13
run
13
run
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user