On 26/02/2025 15.03, Alex Bennée wrote:
In preparation for handling more tests split out the common machine
setup details from the test specific stuff.
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <[email protected]>
---
tests/functional/test_aarch64_virt_gpu.py | 30 +++++++++++------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/tests/functional/test_aarch64_virt_gpu.py
b/tests/functional/test_aarch64_virt_gpu.py
index f21ae18392..06093c6b60 100755
--- a/tests/functional/test_aarch64_virt_gpu.py
+++ b/tests/functional/test_aarch64_virt_gpu.py
@@ -39,12 +39,7 @@ def wait_for_console_pattern(self, success_message, vm=None):
'rootfs.ext4.zstd',
'792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4')
- @skipIfMissingCommands('zstd')
- def test_aarch64_virt_with_vulkan_gpu(self):
- # This tests boots with a buildroot test image that contains
- # vkmark and other GPU exercising tools. We run a headless
- # weston that nevertheless still exercises the virtio-gpu
- # backend.
+ def _run_virt_gpu_test(self, gpu_device, weston_cmd, weston_pattern):
self.set_machine('virt')
self.require_accelerator("tcg")
@@ -62,10 +57,10 @@ def test_aarch64_virt_with_vulkan_gpu(self):
'-kernel', kernel_path,
'-append', kernel_command_line)
self.vm.add_args("-smp", "2", "-m", "2048")
- self.vm.add_args("-device",
- "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on")
- self.vm.add_args("-display", "egl-headless")
- self.vm.add_args("-display", "dbus,gl=on")
+ self.vm.add_args("-device", gpu_device)
+ for opt in ["egl-headless", "dbus,gl=on"]:
+ self.vm.add_args("-display", opt)
What's the advantage of changing the two -display lines here? The code is
hardly shorter and IMHO rather more difficult to read...?
Anyway,
Reviewed-by: Thomas Huth <[email protected]>