diff mbox series

[RFC,RESEND,41/42] tests/functional: Add split_available() helper

Message ID 20250620172751.94231-42-philmd@linaro.org
State New
Headers show
Series accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF | expand

Commit Message

Philippe Mathieu-Daudé June 20, 2025, 5:27 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 python/qemu/utils/__init__.py          |  3 ++-
 python/qemu/utils/accel.py             | 10 ++++++++++
 tests/functional/qemu_test/testcase.py |  4 +++-
 3 files changed, 15 insertions(+), 2 deletions(-)

Comments

Richard Henderson June 22, 2025, 3:36 a.m. UTC | #1
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> +    return 'split' in list_accel(qemu_bin) \
> +           and tcg_available(qemu_bin) \
> +           and hvf_available(qemu_bin)

Do you really need 3 checks?  Kconfig gates on this already.

r~
diff mbox series

Patch

diff --git a/python/qemu/utils/__init__.py b/python/qemu/utils/__init__.py
index d2fe5db223c..74218b9f2c6 100644
--- a/python/qemu/utils/__init__.py
+++ b/python/qemu/utils/__init__.py
@@ -23,7 +23,8 @@ 
 from typing import Optional
 
 # pylint: disable=import-error
-from .accel import hvf_available, kvm_available, list_accel, tcg_available
+from .accel import hvf_available, kvm_available, list_accel, tcg_available, \
+                   split_available
 
 
 __all__ = (
diff --git a/python/qemu/utils/accel.py b/python/qemu/utils/accel.py
index 376d1e30005..0f58998b2f7 100644
--- a/python/qemu/utils/accel.py
+++ b/python/qemu/utils/accel.py
@@ -90,3 +90,13 @@  def hvf_available(qemu_bin: str) -> bool:
     @param qemu_bin (str): path to the QEMU binary
     """
     return 'hvf' in list_accel(qemu_bin)
+
+def split_available(qemu_bin: str) -> bool:
+    """
+    Check if split accelerator is available.
+
+    @param qemu_bin (str): path to the QEMU binary
+    """
+    return 'split' in list_accel(qemu_bin) \
+           and tcg_available(qemu_bin) \
+           and hvf_available(qemu_bin)
diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 2082c6fce43..b6a534a29f0 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -23,7 +23,8 @@ 
 import uuid
 
 from qemu.machine import QEMUMachine
-from qemu.utils import hvf_available, kvm_available, tcg_available
+from qemu.utils import hvf_available, kvm_available, tcg_available, \
+                       split_available
 
 from .archive import archive_extract
 from .asset import Asset
@@ -319,6 +320,7 @@  def require_accelerator(self, accelerator):
         checker = {'tcg': tcg_available,
                    'kvm': kvm_available,
                    'hvf': hvf_available,
+                   'split': split_available,
                   }.get(accelerator)
         if checker is None:
             self.skipTest("Don't know how to check for the presence "