tests: Add realview64-kvm.py test to quick regressions
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 13 Jul 2020 14:16:56 +0000 (15:16 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 9 Nov 2020 09:46:03 +0000 (09:46 +0000)
By using the valid_host parameter we can make sure the test is
run on a aarch64 host only

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I3cdb35967e85377f26adf73ad147cb2479162ca1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31219
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

tests/gem5/fs/linux/arm/test.py

index 482dd1d224cebfa5f0c28652e4b89335c8328bc1..b02d1afdfb490b35986030d53317a3b26fce920f 100644 (file)
@@ -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,)
     )