Split test kernel modules to a separate script.

Notice that Python sucks and does SIGPIPE annoyances, for now work around
by grepping the output file...

Fix the exit status read check with 'b', it broke down occasionally with:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 1832: invalid start byte
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-09-16 09:09:37 +01:00
parent 72d18a72b2
commit b2238daee3
5 changed files with 33 additions and 9 deletions

10
run
View File

@@ -105,9 +105,7 @@ def main(args, extra_args=None):
raise_rootfs_not_found()
common.raw_to_qcow2(prebuilt=args.prebuilt, reverse=True)
if not os.path.exists(common.vmlinux):
# This would allow us to run the prebuilt QEMU Linux image.
# but TODO cannot convert Image to vmlinux on aarch64:
# run-detectors: unable to find an interpreter for
# This is to run gem5 from a prebuilt download.
if not os.path.exists(common.linux_image):
raise Exception('Linux kernel image not found. Did you compile it?\n' \
'Tried: ' + common.vmlinux)
@@ -305,11 +303,11 @@ def main(args, extra_args=None):
if args.gem5:
# We have to do some parsing here because gem5 exits with status 0 even when panic happens.
# Grepping for '^panic: ' does not work because some errors don't show that message.
panic_msg = '--- BEGIN LIBC BACKTRACE ---$'
panic_msg = b'--- BEGIN LIBC BACKTRACE ---$'
else:
panic_msg = 'Kernel panic - not syncing'
panic_msg = b'Kernel panic - not syncing'
panic_re = re.compile(panic_msg)
with open(common.termout_file, 'r') as logfile:
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')