From c306cb071f1b5f7c3ec2de355930192b1fa27710 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 13 Jul 2020 15:16:56 +0100 Subject: [PATCH] tests: Add realview64-kvm.py test to quick regressions By using the valid_host parameter we can make sure the test is run on a aarch64 host only Signed-off-by: Giacomo Travaglini Change-Id: I3cdb35967e85377f26adf73ad147cb2479162ca1 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31219 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Jason Lowe-Power --- tests/gem5/fs/linux/arm/test.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/gem5/fs/linux/arm/test.py b/tests/gem5/fs/linux/arm/test.py index 482dd1d22..b02d1afdf 100644 --- a/tests/gem5/fs/linux/arm/test.py +++ b/tests/gem5/fs/linux/arm/test.py @@ -41,6 +41,10 @@ from os.path import join as joinpath from testlib import * +arm_fs_kvm_tests = [ + 'realview64-kvm', +] + arm_fs_quick_tests = [ 'realview64-simple-atomic', 'realview64-simple-atomic-dual', @@ -49,7 +53,7 @@ arm_fs_quick_tests = [ 'realview64-simple-timing-dual', 'realview64-switcheroo-atomic', 'realview64-switcheroo-timing', -] +] + arm_fs_kvm_tests arm_fs_long_tests = [ 'realview-simple-atomic', @@ -94,7 +98,21 @@ filepath = os.path.dirname(os.path.abspath(__file__)) path = joinpath(config.bin_path, 'arm') arm_fs_binaries = DownloadedArchive(url, path, tarball) +def support_kvm(): + return os.access("/dev/kvm", os.R_OK | os.W_OK) + for name in arm_fs_quick_tests: + if name in arm_fs_kvm_tests: + # The current host might not be supporting KVM + # Skip the test if that's the case + if not support_kvm(): + continue + + # Run KVM test if we are on an arm host only + valid_hosts = (constants.host_arm_tag,) + else: + valid_hosts = constants.supported_hosts + args = [ joinpath(config.base_dir, 'tests', 'gem5', 'configs', name + '.py'), path, @@ -107,6 +125,7 @@ for name in arm_fs_quick_tests: config_args=args, valid_isas=(constants.arm_tag,), length=constants.quick_tag, + valid_hosts=valid_hosts, fixtures=(arm_fs_binaries,) ) -- 2.30.2