From fe579ef08c323164eec4daab8505be271c134d1a Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Fri, 9 Apr 2021 13:39:17 +0100 Subject: [PATCH] tests: Use MatchFileRegex vierifier for realview regressions We have seen cases where the primary CPU was not able to bootstrap the secondary CPUs in multicore tests (dual). The Linux booting process "quietly" gives up (no panic) and it completes the booting without bringing up the seondary CPU(s). This makes the dual test useless as it is supposed to test SMP setups. By adding a MatchFileRegex verifier, we make sure we are able to catch these cases, correctly raising an error if not all CPUs are available. We do this by inspecting the kernel log for the following print: "CPU1: Booted secondary processor" There are probably more resilient alternatives to a regex based check, but those require a less minimal rootfs (the current m5_exit.squashfs.arm64 FS has a single /sbin/init binary executing a simple m5 exit operation) Signed-off-by: Giacomo Travaglini Change-Id: I37e0882967443449d5fedfe3963bd25528a030f8 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44446 Tested-by: kokoro Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- tests/gem5/fs/linux/arm/test.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/gem5/fs/linux/arm/test.py b/tests/gem5/fs/linux/arm/test.py index be612361f7..bf9f517055 100644 --- a/tests/gem5/fs/linux/arm/test.py +++ b/tests/gem5/fs/linux/arm/test.py @@ -41,6 +41,8 @@ from os.path import join as joinpath from testlib import * +import re + arm_fs_kvm_tests = [ 'realview64-kvm', 'realview64-kvm-dual', @@ -102,6 +104,15 @@ arm_fs_binaries = DownloadedArchive(url, path, tarball) def support_kvm(): return os.access("/dev/kvm", os.R_OK | os.W_OK) +def verifier_list(name): + verifiers=[] + if "dual" in name: + verifiers.append(verifier.MatchFileRegex( + re.compile(r'.*CPU1: Booted secondary processor.*'), + ["system.terminal"])) + + return verifiers + for name in arm_fs_quick_tests: if name in arm_fs_kvm_tests: # The current host might not be supporting KVM @@ -121,7 +132,7 @@ for name in arm_fs_quick_tests: ] gem5_verify_config( name=name, - verifiers=(), # Add basic stat verifiers + verifiers=verifier_list(name), # Add basic stat verifiers config=joinpath(filepath, 'run.py'), config_args=args, valid_isas=(constants.arm_tag,), @@ -138,7 +149,7 @@ for name in arm_fs_long_tests: ] gem5_verify_config( name=name, - verifiers=(), # TODO: Add basic stat verifiers + verifiers=verifier_list(name), # TODO: Add basic stat verifiers config=joinpath(filepath, 'run.py'), config_args=args, valid_isas=(constants.arm_tag,),