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>
This commit is contained in:
parent
c04b4d9e6b
commit
8ee6e2811d
@ -17,10 +17,6 @@ import socket
|
|||||||
import subprocess
|
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():
|
def pick_default_vug_bin():
|
||||||
relative_path = "./contrib/vhost-user-gpu/vhost-user-gpu"
|
relative_path = "./contrib/vhost-user-gpu/vhost-user-gpu"
|
||||||
if is_readable_executable_file(relative_path):
|
if is_readable_executable_file(relative_path):
|
||||||
@ -66,8 +62,7 @@ class VirtioGPUx86(Test):
|
|||||||
self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash"
|
self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash"
|
||||||
)
|
)
|
||||||
# FIXME: should check presence of virtio, virgl etc
|
# FIXME: should check presence of virtio, virgl etc
|
||||||
if not kvm_available(self.arch, self.qemu_bin):
|
self.require_accelerator('kvm')
|
||||||
self.cancel(KVM_NOT_AVAILABLE)
|
|
||||||
|
|
||||||
kernel_path = self.fetch_asset(self.KERNEL_URL)
|
kernel_path = self.fetch_asset(self.KERNEL_URL)
|
||||||
initrd_path = self.fetch_asset(self.INITRD_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"
|
self.KERNEL_COMMON_COMMAND_LINE + "console=ttyS0 rdinit=/bin/bash"
|
||||||
)
|
)
|
||||||
# FIXME: should check presence of vhost-user-gpu, virgl, memfd etc
|
# FIXME: should check presence of vhost-user-gpu, virgl, memfd etc
|
||||||
if not kvm_available(self.arch, self.qemu_bin):
|
self.require_accelerator('kvm')
|
||||||
self.cancel(KVM_NOT_AVAILABLE)
|
|
||||||
|
|
||||||
vug = pick_default_vug_bin()
|
vug = pick_default_vug_bin()
|
||||||
if not vug:
|
if not vug:
|
||||||
|
Loading…
Reference in New Issue
Block a user