tests/functional/test_virt_vbsa: Skip UEFI test if virtualization not supported
If you try to run the functional tests on an AArch64 host which doesn't support nested virtualization in KVM, the UEFI test fails with: Output: qemu-system-aarch64: mach-virt: host kernel KVM does not support providing Virtualization extensions to the guest CPU Catch the VMLaunchFailure exception and if it matches the error messages the virt board puts out for virtualization not being supported, skip the test. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260507194728.2034696-3-peter.maydell@linaro.org
Peter Maydell committed
May 7, 2026 at 20:47 UTC
27bb9b5c6b65be0baaa39024a880fe30551e1411
1 file changed
+9
-1
tests/functional/aarch64/test_virt_vbsa.py
+9
-1
@@ -17,6 +17,7 @@ from qemu_test import QemuSystemTest, Asset
17
from qemu_test import get_qemu_img, skipIfMissingCommands
18
from qemu_test import wait_for_console_pattern
19
from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
20
+from qemu.machine.machine import VMLaunchFailure
21
22
23
@skipIfMissingCommands("mformat", "mcopy", "mmd")
@@ -96,7 +97,14 @@ class Aarch64VirtMachine(QemuSystemTest):
97
f'file={img_path},format=raw,if=none,id=drive0')
98
self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')
99
99
- self.vm.launch()
100
+ try:
101
+ self.vm.launch()
102
+ except VMLaunchFailure as excp:
103
+ if "does not support providing Virtualization" in excp.output:
104
+ self.skipTest("accelerator has no virtualization support")
105
+ else:
106
+ self.log.info("unhandled launch failure: %s", excp.output)
107
+ raise excp
108
109
# wait for EFI prompt
110
self.wait_for_console_pattern('Shell>')