diff mbox series

tests/functional: skip vulkan tests when not configured

Message ID 20250309171908.3087067-1-alex.bennee@linaro.org
State New
Headers show
Series tests/functional: skip vulkan tests when not configured | expand

Commit Message

Alex Bennée March 9, 2025, 5:19 p.m. UTC
The CI images don't have the vulkan drivers for the non-existent
hardware even if they can't see the DRI devices. Skip the test early
in this case. While at it fix the missing logging which doesn't seem
to like f-strings.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/functional/test_aarch64_virt_gpu.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py
index c6f7738e93..f19a47f8b6 100755
--- a/tests/functional/test_aarch64_virt_gpu.py
+++ b/tests/functional/test_aarch64_virt_gpu.py
@@ -18,7 +18,7 @@ 
 from qemu_test.linuxkernel import LinuxKernelTest
 
 from re import search
-from subprocess import check_output
+from subprocess import check_output, CalledProcessError
 
 class Aarch64VirtGPUMachine(LinuxKernelTest):
 
@@ -75,7 +75,7 @@  def _launch_virt_gpu(self, gpu_device):
             elif "'type' does not accept value 'egl-headless'" in excp.output:
                 self.skipTest("egl-headless support is not available")
             else:
-                self.log.info(f"unhandled launch failure: {excp.output}")
+                self.log.info("unhandled launch failure: %s", excp.output)
                 raise excp
 
         self.wait_for_console_pattern('buildroot login:')
@@ -119,7 +119,11 @@  def test_aarch64_virt_with_vulkan_gpu(self):
 
         self.require_device('virtio-gpu-gl-pci')
 
-        vk_info = check_output(["vulkaninfo", "--summary"], encoding="utf-8")
+        try:
+            vk_info = check_output(["vulkaninfo", "--summary"],
+                                   encoding="utf-8")
+        except CalledProcessError as excp:
+            self.skipTest(f"Miss-configured host Vulkan: {excp.output}")
 
         if search(r"driverID\s+=\s+DRIVER_ID_NVIDIA_PROPRIETARY", vk_info):
             self.skipTest("Test skipped on NVIDIA proprietary driver")