OSDN Git Service

tests/avocado: Skip tests that require a missing accelerator
authorFabiano Rosas <farosas@suse.de>
Mon, 13 Feb 2023 20:29:17 +0000 (17:29 -0300)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 16 Feb 2023 16:26:17 +0000 (16:26 +0000)
If a test was tagged with the "accel" tag and the specified
accelerator it not present in the qemu binary, cancel the test.

We can now write tests without explicit calls to require_accelerator,
just the tag is enough.

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/avocado/avocado_qemu/__init__.py

index 25a5468..a313e88 100644 (file)
@@ -274,6 +274,10 @@ class QemuSystemTest(QemuBaseTest):
 
         super().setUp('qemu-system-')
 
+        accel_required = self._get_unique_tag_val('accel')
+        if accel_required:
+            self.require_accelerator(accel_required)
+
         self.machine = self.params.get('machine',
                                        default=self._get_unique_tag_val('machine'))