]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
selftest: efibootpartition.py: fix QEMU_USE_KVM usage
authorMartin Jansa <Martin.Jansa@gmail.com>
Wed, 5 Apr 2023 15:37:07 +0000 (17:37 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 6 Apr 2023 13:29:01 +0000 (14:29 +0100)
* if you don't have QEMU_USE_KVM in local.conf it fails with:

  2023-03-12 18:06:29,591 - oe-selftest - DEBUG - Checking if qemux86-64 is not this MACHINE
  2023-03-12 18:06:29,594 - oe-selftest - INFO -  ... ERROR
  2023-03-12 18:06:29,594 - oe-selftest - INFO - Traceback (most recent call last):
    File "/OE/build/poky/meta/lib/oeqa/core/decorator/__init__.py", line 35, in wrapped_f
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/OE/build/poky/meta/lib/oeqa/selftest/cases/efibootpartition.py", line 18, in test_boot_efi
      if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]):
                               ~~~~~~~^^^^^^^^^^^^^^^^
  KeyError: 'QEMU_USE_KVM'

[YOCTO #12937]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/efibootpartition.py

index e17da9f9a09ebb40e14e35f008ad7d9c434bab48..fa74103dec33e6aae9a62f8e0e37177e8624dd1b 100644 (file)
@@ -15,7 +15,7 @@ class GenericEFITest(OESelftestTestCase):
     @skipIfNotMachine("qemux86-64", "test is qemux86-64 specific currently")
     def test_boot_efi(self):
         cmd = "runqemu nographic serial wic ovmf"
-        if oe.types.qemu_use_kvm(self.td['QEMU_USE_KVM'], self.td["TARGET_ARCH"]):
+        if oe.types.qemu_use_kvm(self.td.get('QEMU_USE_KVM', 0), self.td["TARGET_ARCH"]):
             cmd += " kvm"
         image = "core-image-minimal"