Bobby Bruce has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/56829 )

Change subject: tests: Add 'kvm' tag to tests
......................................................................

tests: Add 'kvm' tag to tests

Some of our tests require KVM. Tagging these tests as such allow us to
filter them in or out during testing.

Change-Id: I3f188d3e268409535043cc32b64d99e4657638cd
---
M ext/testlib/configuration.py
M tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
M tests/gem5/kvm-fork-tests/test_kvm_fork_run.py
M tests/gem5/kvm-switch-tests/test_kvm_cpu_switch.py
M tests/gem5/parsec-benchmarks/test_parsec.py
M tests/gem5/suite.py
6 files changed, 30 insertions(+), 1 deletion(-)



diff --git a/ext/testlib/configuration.py b/ext/testlib/configuration.py
index 95800de..c61a809 100644
--- a/ext/testlib/configuration.py
+++ b/ext/testlib/configuration.py
@@ -254,6 +254,8 @@
     constants.host_x86_64_tag = 'x86_64'
     constants.host_arm_tag = 'aarch64'

+    constants.kvm_tag = 'kvm'
+
     constants.supported_tags = {
         constants.isa_tag_type : (
             constants.x86_tag,
diff --git a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
index 6f3300d..f05bb6d 100644
--- a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
+++ b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
@@ -70,6 +70,7 @@
         valid_isas=(constants.x86_tag,),
         valid_hosts=constants.supported_hosts,
         length=constants.long_tag,
+        uses_kvm=True,
     )

 gem5_verify_config(
@@ -108,6 +109,7 @@
         protocol="MESI_Two_Level",
         valid_hosts=constants.supported_hosts,
         length=constants.long_tag,
+        uses_kvm=True,
     )

 if os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
@@ -135,6 +137,7 @@
         protocol="MESI_Two_Level",
         valid_hosts=constants.supported_hosts,
         length=constants.long_tag,
+        uses_kvm=True,
     )

 if os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
@@ -156,6 +159,7 @@
         protocol="MESI_Two_Level",
         valid_hosts=constants.supported_hosts,
         length=constants.long_tag,
+        uses_kvm=True,
     )

 gem5_verify_config(
diff --git a/tests/gem5/kvm-fork-tests/test_kvm_fork_run.py b/tests/gem5/kvm-fork-tests/test_kvm_fork_run.py
index e3a6e64..ddb91c1 100644
--- a/tests/gem5/kvm-fork-tests/test_kvm_fork_run.py
+++ b/tests/gem5/kvm-fork-tests/test_kvm_fork_run.py
@@ -89,6 +89,7 @@
         valid_hosts=constants.supported_hosts,
         protocol=protocol_to_use,
         length=length,
+        uses_kvm=True,
     )


diff --git a/tests/gem5/kvm-switch-tests/test_kvm_cpu_switch.py b/tests/gem5/kvm-switch-tests/test_kvm_cpu_switch.py
index 62ae30c..ffddaa0 100644
--- a/tests/gem5/kvm-switch-tests/test_kvm_cpu_switch.py
+++ b/tests/gem5/kvm-switch-tests/test_kvm_cpu_switch.py
@@ -87,6 +87,7 @@
         valid_hosts=constants.supported_hosts,
         protocol=protocol_to_use,
         length=length,
+        uses_kvm=True,
     )


diff --git a/tests/gem5/parsec-benchmarks/test_parsec.py b/tests/gem5/parsec-benchmarks/test_parsec.py
index 4e10e6e..b659046 100644
--- a/tests/gem5/parsec-benchmarks/test_parsec.py
+++ b/tests/gem5/parsec-benchmarks/test_parsec.py
@@ -88,6 +88,7 @@
         valid_isas=(constants.x86_tag,),
         valid_hosts=constants.supported_hosts,
         length=length,
+        uses_kvm=True,
     )


diff --git a/tests/gem5/suite.py b/tests/gem5/suite.py
index cef3e7d..b29ab33 100644
--- a/tests/gem5/suite.py
+++ b/tests/gem5/suite.py
@@ -59,7 +59,9 @@
                        valid_variants=constants.supported_variants,
                        length=constants.supported_lengths[0],
                        valid_hosts=constants.supported_hosts,
-                       protocol=None):
+                       protocol=None,
+                       uses_kvm=False,
+                    ):
     '''
     Helper class to generate common gem5 tests using verifiers.

@@ -84,6 +86,9 @@

     :param valid_variants: An iterable with the variant levels that
         this test can be ran for. (E.g. opt, debug)
+
+    :param uses_kvm: States if this verifier uses KVM. If so, the "KVM" tag
+        will be included.
     '''
     fixtures = list(fixtures)
     testsuites = []
@@ -123,6 +128,9 @@
                 # Add the isa and variant to tags list.
                 tags = [isa, opt, length, host]

+                if uses_kvm:
+                    tags.append(constants.kvm_tag)
+
                 # Create the gem5 target for the specific architecture and
                 # variant.
                 _fixtures = copy.copy(fixtures)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56829
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3f188d3e268409535043cc32b64d99e4657638cd
Gerrit-Change-Number: 56829
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to