summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2021-07-14 13:40:46 -0400
committerCleber Rosa <crosa@redhat.com>2021-07-20 15:34:20 -0400
commit8ee6e2811db7bc5efb4b75bfc68e6e06b5cf520e (patch)
treeaa496f275d79f69b89ba77991abed99af782dd1e
parentc04b4d9e6b596ead3cf6046a9243fbfee068ef33 (diff)
downloadqemu-8ee6e2811db7bc5efb4b75bfc68e6e06b5cf520e.zip
tests/acceptance/virtio-gpu.py: use require_accelerator()
Since efe30d501 there's a shorthand for requiring specific accelerators, and canceling the test if it's not available. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210714174051.28164-2-crosa@redhat.com> Reviewed-by: Willian Rampazzo <willianr@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
-rw-r--r--tests/acceptance/virtio-gpu.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py
index 589332c1b7..42602a240a 100644
--- a/tests/acceptance/virtio-gpu.py
+++ b/tests/acceptance/virtio-gpu.py
@@ -17,10 +17,6 @@ import socket
import subprocess
-ACCEL_NOT_AVAILABLE_FMT = "%s accelerator does not seem to be available"
-KVM_NOT_AVAILABLE = ACCEL_NOT_AVAILABLE_FMT % "KVM"
-
-
def pick_default_vug_bin():
relative_path = "./contrib/vhost-user-gpu/vhost-user-gpu"
if is_readable_executable_file(relative_path):
@@ -66,8 +62,7 @@ class VirtioGPUx86(Test):
self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash"
)
# FIXME: should check presence of virtio, virgl etc
- if not kvm_available(self.arch, self.qemu_bin):
- self.cancel(KVM_NOT_AVAILABLE)
+ self.require_accelerator('kvm')
kernel_path = self.fetch_asset(self.KERNEL_URL)
initrd_path = self.fetch_asset(self.INITRD_URL)
@@ -107,8 +102,7 @@ class VirtioGPUx86(Test):
self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash"
)
# FIXME: should check presence of vhost-user-gpu, virgl, memfd etc
- if not kvm_available(self.arch, self.qemu_bin):
- self.cancel(KVM_NOT_AVAILABLE)
+ self.require_accelerator('kvm')
vug = pick_default_vug_bin()
if not vug: