subtree updates

meta-openembedded: 9a52bfc4a6..af11f6ce73:
  Andreas Müller (4):
        nautilus: Add a packageconfig for libportal - disabled by default
        gtk4: upgrade 4.4.0 -> 4.6.2
        libadwaita: initial add 1.1.0
        gtksourceview5: upgrade 5.2.0 -> 5.4.0

  Carlos Rafael Giani (3):
        libopenmpt: Remove unnecessary python code block
        pipewire: Upgrade to version 0.3.49
        wireplumber: Upgrade to version 0.4.9

  Kai Kang (4):
        wxwidgets: 3.1.4 -> 3.1.5
        python3-wxgtk4: add recipe
        wxwidgets: fix typo
        mcelog: fix compile error

  Khem Raj (1):
        python3-wxgtk4: Use cross prefix with native wx-config

  Matthias Klein (1):
        paho-mqtt-c: upgrade 1.3.9 -> 1.3.10

  Mingli Yu (1):
        mariadb: increase MY_AES_CTX_SIZE

  Potin Lai (4):
        libimobiledevice-glue: add recipe
        libimobiledevice-glue: fix undefined bswap error
        libirecovery: add recipe
        idevicerestore: add recipe

  S. Lockwood-Childs (1):
        python3-evdev: fix host header contamination

  Yi Zhao (2):
        strongswan: 5.9.4 -> 5.9.5
        libnetfilter-conntrack: upgrade 1.0.8 -> 1.0.9

meta-raspberrypi: c06ae5eacf..31c33d155c:
  Khem Raj (3):
        linux-raspberrypi_5.15.bb: Upgrade to 5.15.32
        raspberrypi-firmware: Update to match 5.15.32
        armstubs: Upgrade to 20211101

poky: 5fe3689f4f..1976521190:
  Chen Qi (1):
        gobject-introspection: fix default search path for girdir

  Daniel Ammann (2):
        overview-manual: Fix reference
        ref-manual: Add vfat in list of filesystems supported by kickstart

  Jagadeesh Krishnanjanappa (1):
        cmake: support to create per-toolchain cmake file in SDK

  Khem Raj (2):
        weston: Add a knob to control simple clients
        meson: Robustify compiler detection logic

  Marta Rybczynska (1):
        doc: migration-3.5: extend the section on inclusive language

  Michael Halstead (1):
        releases: update to include 3.4.3

  Michael Opdenacker (4):
        overview-manual: add missing upper case
        docs: add poky.yaml and sphinx-static/switchers.js to "make clean"
        manuals: fix quoting of double dashes
        migration-guides: preliminary description for 3.5

  Oleksandr Kravchuk (1):
        python3: update to 3.10.4

  Peter Kjellerstedt (1):
        ref-manual: Remove references to AVAILABLE_LICENSES

  Rasmus Villemoes (1):
        git: make expat and curl into PACKAGECONFIG items

  Richard Purdie (11):
        set_versions/switchers: Drop versions shown to the active releases
        mirrors: Add missing gitsm entries for yocto/oe mirrors
        base: Don't add duplicates to sys.path
        base: Clean up module import compatibility code
        modutils-initscripts: Change license PD -> MIT
        keymaps: Clean up license handling
        initscripts: Clean up license handling/identifiers
        bitbake: cooker: Further fixes to inotify to fix memres bitbake issues
        bitbake: cooker: Restore sys.path and sys.modules between parses
        bitbake: cooker: Ensure any existing hashserv connection is closed
        bitbake: cooker: Avoid error if siggen wasn't setup

  Ross Burton (24):
        ref-manual: update Python class documentation
        buildtools-tarball: include nativesdk-python3-pyyaml
        image_types: hddimg and iso only work on x86
        oeqa/selftest/devtool: ensure Git username is set before upgrade tests
        oeqa/selftest/wic: use os.rename instead of bb.utils.rename
        oeqa/selftest/wic: remove redundant asserts
        oeqa/selftest/wic: clean up only_for_arch decorator
        oeqa/selftest/wic: don't hardcode kernel image type in test_wic_rm
        oeqa/selftest/wic: add more arch-specific annotations
        oeqa/selftest/buildoptions: set PACKAGE_CLASSES in test_arch_work_dir_and_export_source
        oeqa/runtime/decorator/package.py: remove use of strToSet
        oeqa/core/decorator: remove redundant code
        testimage: inline updateTestData()
        oeqa/core/utils/misc: remove redundant file
        oeqa/selftest: remove unused imports
        oeqa/core/decorators/data: improve has_* logic
        oeqa/selftest: tag tests that use runqemu
        oeqa: rationalise skipifqemu decorators
        oeqa/selftest/oescripts: refactor skipping logic
        oeqa/selftest/wic: cleanup WicTestCase.setUpLocal
        oeqa/selftest/wic: rearrange tests
        oeqa/selftest/wic: use os.path.join to join paths
        oeqa/selftest/wic: use self.td instead of get_bb_var to save on bitbake calls
        oeqa/selftest: generalise test_devtool_virtual_kernel_modify

  Simon Kuhnle (1):
        convert-variable-renames: Fix typo in description

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic8359fe5772351a45a3154c6a7f5042a88ff934c
diff --git a/poky/meta/lib/oeqa/core/decorator/__init__.py b/poky/meta/lib/oeqa/core/decorator/__init__.py
index 1a82518..93efd30 100644
--- a/poky/meta/lib/oeqa/core/decorator/__init__.py
+++ b/poky/meta/lib/oeqa/core/decorator/__init__.py
@@ -5,8 +5,7 @@
 #
 
 from functools import wraps
-from abc import abstractmethod, ABCMeta
-from oeqa.core.utils.misc import strToList
+from abc import ABCMeta
 
 decoratorClasses = set()
 
@@ -65,15 +64,11 @@
         return registry['cases']
 
 def OETestTag(*tags):
-    expandedtags = []
-    for tag in tags:
-        expandedtags += strToList(tag)
     def decorator(item):
         if hasattr(item, "__oeqa_testtags"):
             # do not append, create a new list (to handle classes with inheritance)
-            item.__oeqa_testtags = list(item.__oeqa_testtags) + expandedtags
+            item.__oeqa_testtags = list(item.__oeqa_testtags) + list(tags)
         else:
-            item.__oeqa_testtags = expandedtags
+            item.__oeqa_testtags = tags
         return item
     return decorator
-
diff --git a/poky/meta/lib/oeqa/core/decorator/data.py b/poky/meta/lib/oeqa/core/decorator/data.py
index bc4939e..3ce10e5 100644
--- a/poky/meta/lib/oeqa/core/decorator/data.py
+++ b/poky/meta/lib/oeqa/core/decorator/data.py
@@ -13,8 +13,8 @@
         Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
     """
 
-    if (feature in td.get('DISTRO_FEATURES', '') or
-        feature in td.get('IMAGE_FEATURES', '')):
+    if (feature in td.get('DISTRO_FEATURES', '').split() or
+        feature in td.get('IMAGE_FEATURES', '').split()):
         return True
     return False
 
@@ -23,18 +23,7 @@
         Checks for MACHINE.
     """
 
-    if (machine in td.get('MACHINE', '')):
-        return True
-    return False
-
-def is_qemu(td, qemu):
-    """
-        Checks if MACHINE is qemu.
-    """
-
-    machine = td.get('MACHINE', '')
-    if (qemu in td.get('MACHINE', '') or
-    machine.startswith('qemu')):
+    if (machine == td.get('MACHINE', '')):
         return True
     return False
 
@@ -189,34 +178,19 @@
 @registerDecorator
 class skipIfNotQemu(OETestDecorator):
     """
-        Skip test based on MACHINE.
-
-        value must be a qemu MACHINE or it will skip the test
-        with msg as the reason.
+    Skip test if MACHINE is not qemu*
     """
-
-    attrs = ('value', 'msg')
-
     def setUpDecorator(self):
-        msg = ('Checking if %s is not this MACHINE' % self.value)
-        self.logger.debug(msg)
-        if not is_qemu(self.case.td, self.value):
-            self.case.skipTest(self.msg)
+        self.logger.debug("Checking if not qemu MACHINE")
+        if not self.case.td.get('MACHINE', '').startswith('qemu'):
+            self.case.skipTest('Test only runs on qemu machines')
 
 @registerDecorator
 class skipIfQemu(OETestDecorator):
     """
-        Skip test based on Qemu Machine.
-
-        value must not be a qemu machine or it will skip the test
-        with msg as the reason.
-   """
-
-    attrs = ('value', 'msg')
-
+    Skip test if MACHINE is qemu*
+    """
     def setUpDecorator(self):
-        msg = ('Checking if %s is this MACHINE' % self.value)
-        self.logger.debug(msg)
-        if is_qemu(self.case.td, self.value):
-             self.case.skipTest(self.msg)
-
+        self.logger.debug("Checking if qemu MACHINE")
+        if self.case.td.get('MACHINE', '').startswith('qemu'):
+             self.case.skipTest('Test only runs on real hardware')
diff --git a/poky/meta/lib/oeqa/core/utils/misc.py b/poky/meta/lib/oeqa/core/utils/misc.py
deleted file mode 100644
index e1a5958..0000000
--- a/poky/meta/lib/oeqa/core/utils/misc.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2016 Intel Corporation
-#
-# SPDX-License-Identifier: MIT
-#
-
-def toList(obj, obj_type, obj_name="Object"):
-    if isinstance(obj, obj_type):
-        return [obj]
-    elif isinstance(obj, list):
-        return obj
-    else:
-        raise TypeError("%s must be %s or list" % (obj_name, obj_type))
-
-def toSet(obj, obj_type, obj_name="Object"):
-    if isinstance(obj, obj_type):
-        return {obj}
-    elif isinstance(obj, list):
-        return set(obj)
-    elif isinstance(obj, set):
-        return obj
-    else:
-        raise TypeError("%s must be %s or set" % (obj_name, obj_type))
-
-def strToList(obj, obj_name="Object"):
-    return toList(obj, str, obj_name)
-
-def strToSet(obj, obj_name="Object"):
-    return toSet(obj, str, obj_name)
-
-def intToList(obj, obj_name="Object"):
-    return toList(obj, int, obj_name)
-
-def dataStoteToDict(d, variables):
-    data = {}
-
-    for v in variables:
-        data[v] = d.getVar(v)
-
-    return data
-
-def updateTestData(d, td, variables):
-    """
-    Updates variables with values of data store to test data.
-    """
-    for var in variables:
-        td[var] = d.getVar(var)
diff --git a/poky/meta/lib/oeqa/runtime/cases/boot.py b/poky/meta/lib/oeqa/runtime/cases/boot.py
index 2142f40..e1ad88a 100644
--- a/poky/meta/lib/oeqa/runtime/cases/boot.py
+++ b/poky/meta/lib/oeqa/runtime/cases/boot.py
@@ -13,7 +13,7 @@
 class BootTest(OERuntimeTestCase):
 
     @OETimeout(120)
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_reboot(self):
         output = ''
diff --git a/poky/meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py b/poky/meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
index e010612..b93ee29 100644
--- a/poky/meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
+++ b/poky/meta/lib/oeqa/runtime/cases/ethernet_ip_connman.py
@@ -11,7 +11,7 @@
         x = '.'.join(x)
         return x
     
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')    
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_set_virtual_ip(self):
         (status, output) = self.target.run("ifconfig eth0 | grep 'inet ' | awk '{print $2}'")
@@ -22,6 +22,7 @@
         (status, output) = self.target.run("ifconfig eth0:1 %s netmask 255.255.255.0 && sleep 2 && ping -c 5 %s && ifconfig eth0:1 down" % (virtual_ip,virtual_ip))
         self.assertEqual(status, 0, msg='Failed to create virtual ip address, output: %s' % output)
         
+    @skipIfQemu()
     @OETestDepends(['ethernet_ip_connman.Ethernet_Test.test_set_virtual_ip'])  
     def test_get_ip_from_dhcp(self): 
         (status, output) = self.target.run("connmanctl services | grep -E '*AO Wired|*AR Wired' | awk '{print $3}'")
diff --git a/poky/meta/lib/oeqa/runtime/cases/ltp_stress.py b/poky/meta/lib/oeqa/runtime/cases/ltp_stress.py
index 2445ffb..ce6f4bf 100644
--- a/poky/meta/lib/oeqa/runtime/cases/ltp_stress.py
+++ b/poky/meta/lib/oeqa/runtime/cases/ltp_stress.py
@@ -89,8 +89,7 @@
 
     # LTP stress runtime tests
     #
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
-
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     @OEHasPackage(["ltp"])
     def test_ltp_stress(self):
diff --git a/poky/meta/lib/oeqa/runtime/cases/storage.py b/poky/meta/lib/oeqa/runtime/cases/storage.py
index 166d26b..972ef82 100644
--- a/poky/meta/lib/oeqa/runtime/cases/storage.py
+++ b/poky/meta/lib/oeqa/runtime/cases/storage.py
@@ -91,24 +91,24 @@
         self.test_file = "usb.tst"
         self.test_dir = os.path.join(self.mount_point, "oeqa")
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_usb_mount(self):
         self.storage_umount(2)
         self.storage_mount(5)
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.UsbTest.test_usb_mount'])
     def test_usb_basic_operations(self):
         self.storage_basic()
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.UsbTest.test_usb_basic_operations'])
     def test_usb_basic_rw(self):
         self.storage_write()
         self.storage_read()
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.UsbTest.test_usb_mount'])
     def test_usb_umount(self):
         self.storage_umount(2)
@@ -126,24 +126,24 @@
         self.test_file = "mmc.tst"
         self.test_dir = os.path.join(self.mount_point, "oeqa")
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_mmc_mount(self):
         self.storage_umount(2)
         self.storage_mount()
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.MMCTest.test_mmc_mount'])
     def test_mmc_basic_operations(self):
         self.storage_basic()
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.MMCTest.test_mmc_basic_operations'])
     def test_mmc_basic_rw(self):
         self.storage_write()
         self.storage_read()
 
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['storage.MMCTest.test_mmc_mount'])
     def test_mmc_umount(self):
         self.storage_umount(2)
diff --git a/poky/meta/lib/oeqa/runtime/cases/suspend.py b/poky/meta/lib/oeqa/runtime/cases/suspend.py
index 67b6f7e..0382d48 100644
--- a/poky/meta/lib/oeqa/runtime/cases/suspend.py
+++ b/poky/meta/lib/oeqa/runtime/cases/suspend.py
@@ -23,7 +23,7 @@
         (status, output) = self.target.run('sudo rtcwake -m mem -s 10')
         self.assertEqual(status, 0,  msg = 'Failed to suspends your system to RAM, output : %s' % output)
     
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_suspend(self):
         self.test_date()
diff --git a/poky/meta/lib/oeqa/runtime/cases/usb_hid.py b/poky/meta/lib/oeqa/runtime/cases/usb_hid.py
index 3c292cf..8743174 100644
--- a/poky/meta/lib/oeqa/runtime/cases/usb_hid.py
+++ b/poky/meta/lib/oeqa/runtime/cases/usb_hid.py
@@ -14,7 +14,7 @@
         return self.assertEqual(status, 0,  msg = 'Failed to suspends your system to RAM, output : %s' % output)
     
     @OEHasPackage(['xdotool'])
-    @skipIfQemu('qemuall', 'Test only runs on real hardware')
+    @skipIfQemu()
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     def test_USB_Hid_input(self):
         self.keyboard_mouse_simulation()
diff --git a/poky/meta/lib/oeqa/runtime/decorator/package.py b/poky/meta/lib/oeqa/runtime/decorator/package.py
index 2d7e174..8aba3f3 100644
--- a/poky/meta/lib/oeqa/runtime/decorator/package.py
+++ b/poky/meta/lib/oeqa/runtime/decorator/package.py
@@ -5,7 +5,6 @@
 #
 
 from oeqa.core.decorator import OETestDecorator, registerDecorator
-from oeqa.core.utils.misc import strToSet
 
 @registerDecorator
 class OEHasPackage(OETestDecorator):
@@ -34,8 +33,12 @@
     def setUpDecorator(self):
         need_pkgs = set()
         unneed_pkgs = set()
-        pkgs = strToSet(self.need_pkgs)
-        for pkg in pkgs:
+
+        # Turn literal strings into a list so we can just iterate over it
+        if isinstance(self.need_pkgs, str):
+            self.need_pkgs = [self.need_pkgs,]
+
+        for pkg in self.need_pkgs:
             if pkg.startswith('!'):
                 unneed_pkgs.add(pkg[1:])
             else:
diff --git a/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py b/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
index 7ac03f0..bff6e77 100644
--- a/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
+++ b/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
@@ -6,7 +6,7 @@
 import shutil
 
 import oeqa.utils.ftools as ftools
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
 from oeqa.selftest.cases.sstate import SStateBase
 
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/binutils.py b/poky/meta/lib/oeqa/selftest/cases/binutils.py
index 821f52f..3b0b44b 100644
--- a/poky/meta/lib/oeqa/selftest/cases/binutils.py
+++ b/poky/meta/lib/oeqa/selftest/cases/binutils.py
@@ -1,12 +1,9 @@
 # SPDX-License-Identifier: MIT
 import os
-import sys
-import re
-import logging
 from oeqa.core.decorator import OETestTag
 from oeqa.core.case import OEPTestResultTestCase
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars
+from oeqa.utils.commands import bitbake, get_bb_vars
 
 def parse_values(content):
     for i in content:
diff --git a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
index bfe613b..ad604d6 100644
--- a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
+++ b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -9,7 +9,7 @@
 import tempfile
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.selftest.cases.buildhistory import BuildhistoryBase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars
 import oeqa.utils.ftools as ftools
 
 class ImageOptionsTests(OESelftestTestCase):
@@ -177,7 +177,12 @@
         """
         Test for archiving the work directory and exporting the source files.
         """
-        self.write_config("INHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
+        self.write_config("""
+INHERIT += "archiver"
+PACKAGE_CLASSES = "package_rpm"
+ARCHIVER_MODE[src] = "original"
+ARCHIVER_MODE[srpm] = "1"
+""")
         res = bitbake("xcursor-transparent-theme", ignore_status=True)
         self.assertEqual(res.status, 0, "\nCouldn't build xcursortransparenttheme.\nbitbake output %s" % res.output)
         deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
diff --git a/poky/meta/lib/oeqa/selftest/cases/devtool.py b/poky/meta/lib/oeqa/selftest/cases/devtool.py
index e910672..3eea2b1 100644
--- a/poky/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/poky/meta/lib/oeqa/selftest/cases/devtool.py
@@ -9,10 +9,10 @@
 import glob
 import fnmatch
 
-import oeqa.utils.ftools as ftools
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
 from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
+from oeqa.core.decorator import OETestTag
 
 oldmetapath = None
 
@@ -1351,6 +1351,7 @@
         matches2 = glob.glob(stampprefix2 + '*')
         self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
 
+    @OETestTag("runqemu")
     def test_devtool_deploy_target(self):
         # NOTE: Whilst this test would seemingly be better placed as a runtime test,
         # unfortunately the runtime tests run under bitbake and you can't run
@@ -1471,6 +1472,14 @@
 
 class DevtoolUpgradeTests(DevtoolBase):
 
+    def setUp(self):
+        super().setUp()
+        try:
+            runCmd("git config --global user.name")
+            runCmd("git config --global user.email")
+        except:
+            self.skip("Git user.name and user.email must be set")
+
     def test_devtool_upgrade(self):
         # Check preconditions
         self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
@@ -1866,8 +1875,9 @@
          Expected:       devtool modify is able to checkout the source of the kernel
                          and modification to the source and configurations are reflected
                          when building the kernel.
-         """
-        kernel_provider = get_bb_var('PREFERRED_PROVIDER_virtual/kernel')
+        """
+        kernel_provider = self.td['PREFERRED_PROVIDER_virtual/kernel']
+
         # Clean up the environment
         bitbake('%s -c clean' % kernel_provider)
         tempdir = tempfile.mkdtemp(prefix='devtoolqa')
@@ -1894,33 +1904,28 @@
         self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
         #Step 4.2
         configfile = os.path.join(tempdir,'.config')
-        diff = runCmd('diff %s %s' % (tmpconfig, configfile))
-        self.assertEqual(0,diff.status,'Kernel .config file is not the same using bitbake and devtool')
+        runCmd('diff %s %s' % (tmpconfig, configfile))
+
         #Step 4.3
         #NOTE: virtual/kernel is mapped to kernel_provider
-        result = runCmd('devtool build %s' % kernel_provider)
-        self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`')
+        runCmd('devtool build %s' % kernel_provider)
         kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux')
         self.assertExists(kernelfile, 'Kernel was not build correctly')
 
         #Modify the kernel source
-        modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
-        modstring = "Use a boot loader. Devtool testing."
-        modapplied = runCmd("sed -i 's/Use a boot loader./%s/' %s" % (modstring, modfile))
-        self.assertEqual(0,modapplied.status,'Modification to %s on kernel source failed' % modfile)
+        modfile = os.path.join(tempdir, 'init/version.c')
+        runCmd("sed -i 's/Linux/LiNuX/g' %s" % (modfile))
+
         #Modify the configuration
-        codeconfigfile = os.path.join(tempdir,'.config.new')
+        codeconfigfile = os.path.join(tempdir, '.config.new')
         modconfopt = "CONFIG_SG_POOL=n"
-        modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile))
-        self.assertEqual(0,modconf.status,'Modification to %s failed' % codeconfigfile)
+        runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile))
+
         #Build again kernel with devtool
-        rebuild = runCmd('devtool build %s' % kernel_provider)
-        self.assertEqual(0,rebuild.status,'Fail to build kernel after modification of source and config')
+        runCmd('devtool build %s' % kernel_provider)
+
         #Step 4.4
-        bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME', kernel_provider)
-        bzimagefile = os.path.join(get_bb_var('D', kernel_provider),'boot', bzimagename)
-        checkmodcode = runCmd("grep '%s' %s" % (modstring, bzimagefile))
-        self.assertEqual(0,checkmodcode.status,'Modification on kernel source failed')
+        runCmd("grep '%s' %s" % ('LiNuX', kernelfile))
+
         #Step 4.5
-        checkmodconfg = runCmd("grep %s %s" % (modconfopt, codeconfigfile))
-        self.assertEqual(0,checkmodconfg.status,'Modification to configuration file failed')
+        runCmd("grep %s %s" % (modconfopt, codeconfigfile))
diff --git a/poky/meta/lib/oeqa/selftest/cases/distrodata.py b/poky/meta/lib/oeqa/selftest/cases/distrodata.py
index 03f31e9..b80d091 100644
--- a/poky/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/poky/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -3,9 +3,6 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
-from oeqa.utils.decorators import testcase
-from oeqa.utils.ftools import write_file
 
 import oe.recipeutils
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/eSDK.py b/poky/meta/lib/oeqa/selftest/cases/eSDK.py
index f7279b3..3ea0f66 100644
--- a/poky/meta/lib/oeqa/selftest/cases/eSDK.py
+++ b/poky/meta/lib/oeqa/selftest/cases/eSDK.py
@@ -8,7 +8,7 @@
 import glob
 import time
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+from oeqa.utils.commands import runCmd, bitbake, get_bb_vars
 
 class oeSDKExtSelfTest(OESelftestTestCase):
     """
diff --git a/poky/meta/lib/oeqa/selftest/cases/fitimage.py b/poky/meta/lib/oeqa/selftest/cases/fitimage.py
index f6f6a8e..e6bfd12 100644
--- a/poky/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/poky/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -3,9 +3,8 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
 import os
-import json
 import re
 
 class FitImageTests(OESelftestTestCase):
diff --git a/poky/meta/lib/oeqa/selftest/cases/gcc.py b/poky/meta/lib/oeqa/selftest/cases/gcc.py
index 3efe152..b9ea03a 100644
--- a/poky/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/poky/meta/lib/oeqa/selftest/cases/gcc.py
@@ -3,7 +3,7 @@
 from oeqa.core.decorator import OETestTag
 from oeqa.core.case import OEPTestResultTestCase
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
+from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu
 
 def parse_values(content):
     for i in content:
@@ -114,37 +114,44 @@
         self.run_check("libitm")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
     def test_cross_gcc(self):
         self.run_check_emulated("gcc")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GxxCrossSelfTestSystemEmulated(GccSelfTestBase):
     def test_cross_gxx(self):
         self.run_check_emulated("g++")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
     def test_libatomic(self):
         self.run_check_emulated("libatomic")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
     def test_libgomp(self):
         self.run_check_emulated("libgomp")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
     def test_libstdcxx(self):
         self.run_check_emulated("libstdc++-v3")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
     def test_libssp(self):
         self.check_skip("libssp")
         self.run_check_emulated("libssp")
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
     def test_libitm(self):
         self.check_skip("libitm")
diff --git a/poky/meta/lib/oeqa/selftest/cases/glibc.py b/poky/meta/lib/oeqa/selftest/cases/glibc.py
index 6f96281..6fc98e9 100644
--- a/poky/meta/lib/oeqa/selftest/cases/glibc.py
+++ b/poky/meta/lib/oeqa/selftest/cases/glibc.py
@@ -4,7 +4,7 @@
 from oeqa.core.decorator import OETestTag
 from oeqa.core.case import OEPTestResultTestCase
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
+from oeqa.utils.commands import bitbake, get_bb_var, runqemu
 from oeqa.utils.nfs import unfs_server
 
 def parse_values(content):
@@ -83,6 +83,7 @@
         self.run_check()
 
 @OETestTag("toolchain-system")
+@OETestTag("runqemu")
 class GlibcSelfTestSystemEmulated(GlibcSelfTestBase):
     def test_glibc(self):
         self.run_check_emulated()
diff --git a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
index d36d45c..6b94ace 100644
--- a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -3,6 +3,7 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator import OETestTag
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
 from oeqa.utils.sshcontrol import SSHControl
 import glob
@@ -14,6 +15,7 @@
     test_user = 'tester'
     root_user = 'root'
 
+    @OETestTag("runqemu")
     def test_non_root_user_can_connect_via_ssh_without_password(self):
         """
         Summary: Check if non root user can connect via ssh without password
@@ -39,6 +41,7 @@
                 status, output = ssh.run("true")
                 self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
 
+    @OETestTag("runqemu")
     def test_all_users_can_connect_via_ssh_without_password(self):
         """
         Summary:     Check if all users can connect via ssh without password
diff --git a/poky/meta/lib/oeqa/selftest/cases/layerappend.py b/poky/meta/lib/oeqa/selftest/cases/layerappend.py
index dadc7c5..8fb1e6c 100644
--- a/poky/meta/lib/oeqa/selftest/cases/layerappend.py
+++ b/poky/meta/lib/oeqa/selftest/cases/layerappend.py
@@ -5,7 +5,7 @@
 import os
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import bitbake, get_bb_var
 import oeqa.utils.ftools as ftools
 
 class LayerAppendTests(OESelftestTestCase):
diff --git a/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py b/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py
index 91021ac..f8681ed 100644
--- a/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py
+++ b/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py
@@ -7,7 +7,6 @@
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake
-from oeqa.utils import CommandError
 
 class LicenseTests(OESelftestTestCase):
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/manifest.py b/poky/meta/lib/oeqa/selftest/cases/manifest.py
index 5d13f35..0a04c13 100644
--- a/poky/meta/lib/oeqa/selftest/cases/manifest.py
+++ b/poky/meta/lib/oeqa/selftest/cases/manifest.py
@@ -5,7 +5,7 @@
 import os
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake
+from oeqa.utils.commands import get_bb_var, bitbake
 
 class ManifestEntry:
     '''A manifest item of a collection able to list missing packages'''
diff --git a/poky/meta/lib/oeqa/selftest/cases/oescripts.py b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
index 91abf96..cd68781 100644
--- a/poky/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -8,7 +8,7 @@
 import unittest
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.selftest.cases.buildhistory import BuildhistoryBase
-from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
 from oeqa.utils import CommandError
 
 class BuildhistoryDiffTests(BuildhistoryBase):
@@ -34,21 +34,19 @@
         if expected_endlines:
             self.fail('Missing expected line endings:\n  %s' % '\n  '.join(expected_endlines))
 
-@unittest.skipUnless(importlib.util.find_spec("cairo"), "Python cairo module is not present")
 class OEScriptTests(OESelftestTestCase):
+    scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
+
+@unittest.skipUnless(importlib.util.find_spec("cairo"), "Python cairo module is not present")
+class OEPybootchartguyTests(OEScriptTests):
 
     @classmethod
     def setUpClass(cls):
         super(OEScriptTests, cls).setUpClass()
-        import cairo
         bitbake("core-image-minimal -c rootfs -f")
         cls.tmpdir = get_bb_var('TMPDIR')
         cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
 
-    scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
-
-class OEPybootchartguyTests(OEScriptTests):
-
     def test_pybootchartguy_help(self):
         runCmd('%s/pybootchartgui/pybootchartgui.py  --help' % self.scripts_dir)
 
@@ -65,9 +63,7 @@
         self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf"))
 
 
-class OEGitproxyTests(OESelftestTestCase):
-
-    scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
+class OEGitproxyTests(OEScriptTests):
 
     def test_oegitproxy_help(self):
         try:
diff --git a/poky/meta/lib/oeqa/selftest/cases/overlayfs.py b/poky/meta/lib/oeqa/selftest/cases/overlayfs.py
index 56ae48c..472746a 100644
--- a/poky/meta/lib/oeqa/selftest/cases/overlayfs.py
+++ b/poky/meta/lib/oeqa/selftest/cases/overlayfs.py
@@ -3,7 +3,8 @@
 #
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.commands import bitbake, runqemu
+from oeqa.core.decorator import OETestTag
 
 def getline_qemu(out, line):
     for l in out.split('\n'):
@@ -185,6 +186,7 @@
             line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/another-overlay-mount")
             self.assertTrue(line and line.startswith("overlay"), msg=output)
 
+    @OETestTag("runqemu")
     def test_correct_image_fstab(self):
         """
         Summary:   Check that we can create an image when all parameters are
@@ -203,6 +205,7 @@
 
         self._test_correct_image('base-files', base_files_append)
 
+    @OETestTag("runqemu")
     def test_correct_image_unit(self):
         """
         Summary:   Check that we can create an image when all parameters are
@@ -238,6 +241,7 @@
 
         self._test_correct_image('systemd-machine-units', systemd_machine_unit_append)
 
+@OETestTag("runqemu")
 class OverlayFSEtcRunTimeTests(OESelftestTestCase):
     """overlayfs-etc class tests"""
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/package.py b/poky/meta/lib/oeqa/selftest/cases/package.py
index cebbb4f..51d8352 100644
--- a/poky/meta/lib/oeqa/selftest/cases/package.py
+++ b/poky/meta/lib/oeqa/selftest/cases/package.py
@@ -4,7 +4,6 @@
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, get_bb_vars, get_bb_var, runqemu
-import stat
 import subprocess, os
 import oe.path
 import re
diff --git a/poky/meta/lib/oeqa/selftest/cases/recipeutils.py b/poky/meta/lib/oeqa/selftest/cases/recipeutils.py
index f1dd63f..74b2098 100644
--- a/poky/meta/lib/oeqa/selftest/cases/recipeutils.py
+++ b/poky/meta/lib/oeqa/selftest/cases/recipeutils.py
@@ -2,14 +2,10 @@
 # SPDX-License-Identifier: MIT
 #
 
-import os
-import re
-import time
-import logging
 import bb.tinfoil
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, get_test_layer
+from oeqa.utils.commands import get_test_layer
 
 
 def setUpModule():
diff --git a/poky/meta/lib/oeqa/selftest/cases/reproducible.py b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
index 7caf8c3..5042c11 100644
--- a/poky/meta/lib/oeqa/selftest/cases/reproducible.py
+++ b/poky/meta/lib/oeqa/selftest/cases/reproducible.py
@@ -9,8 +9,6 @@
 import functools
 import multiprocessing
 import textwrap
-import json
-import unittest
 import tempfile
 import shutil
 import stat
diff --git a/poky/meta/lib/oeqa/selftest/cases/runqemu.py b/poky/meta/lib/oeqa/selftest/cases/runqemu.py
index da22f77..c1d277a 100644
--- a/poky/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/poky/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -12,6 +12,7 @@
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd
 
+@OETestTag("runqemu")
 class RunqemuTests(OESelftestTestCase):
     """Runqemu test class"""
 
@@ -149,6 +150,7 @@
 # bootup various filesystem types, including live image(iso and hddimg)
 # where live image was not supported on all qemu architecture.
 @OETestTag("machine")
+@OETestTag("runqemu")
 class QemuTest(OESelftestTestCase):
 
     @classmethod
diff --git a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
index 642f0eb..2ad8949 100644
--- a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -4,16 +4,15 @@
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
-from oeqa.utils.sshcontrol import SSHControl
+from oeqa.core.decorator import OETestTag
 import os
-import re
 import tempfile
-import shutil
 import oe.lsb
 from oeqa.core.decorator.data import skipIfNotQemu
 
 class TestExport(OESelftestTestCase):
 
+    @OETestTag("runqemu")
     def test_testexport_basic(self):
         """
         Summary: Check basic testexport functionality with only ping test enabled.
@@ -106,6 +105,7 @@
             self.assertEqual(0, result.status, "Couldn't run tar from SDK")
 
 
+@OETestTag("runqemu")
 class TestImage(OESelftestTestCase):
 
     def test_testimage_install(self):
@@ -240,6 +240,7 @@
         bitbake('core-image-minimal')
         bitbake('-c testimage core-image-minimal')
 
+@OETestTag("runqemu")
 class Postinst(OESelftestTestCase):
 
     def init_manager_loop(self, init_manager):
@@ -280,7 +281,7 @@
 
 
 
-    @skipIfNotQemu('qemuall', 'Test only runs in qemu')
+    @skipIfNotQemu()
     def test_postinst_rootfs_and_boot_sysvinit(self):
         """
         Summary:        The purpose of this test case is to verify Post-installation
@@ -301,7 +302,7 @@
         self.init_manager_loop("sysvinit")
 
 
-    @skipIfNotQemu('qemuall', 'Test only runs in qemu')
+    @skipIfNotQemu()
     def test_postinst_rootfs_and_boot_systemd(self):
         """
         Summary:        The purpose of this test case is to verify Post-installation
@@ -357,6 +358,7 @@
                 self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")),
                                     "rootfs-after-failure file was created")
 
+@OETestTag("runqemu")
 class SystemTap(OESelftestTestCase):
         """
         Summary:        The purpose of this test case is to verify native crosstap
@@ -433,4 +435,3 @@
                 cmd = "crosstap -r root@192.168.7.2 -s %s/process/ syscalls_by_pid.stp" % systemtap_examples
                 result = runCmd(cmd)
                 self.assertEqual(0, result.status, 'crosstap  syscalls_by_pid returned a non 0 status:%s' % result.output)
-
diff --git a/poky/meta/lib/oeqa/selftest/cases/selftest.py b/poky/meta/lib/oeqa/selftest/cases/selftest.py
index af080dc..7268e25 100644
--- a/poky/meta/lib/oeqa/selftest/cases/selftest.py
+++ b/poky/meta/lib/oeqa/selftest/cases/selftest.py
@@ -3,7 +3,6 @@
 #
 
 import importlib
-from oeqa.utils.commands import runCmd
 import oeqa.selftest
 from oeqa.selftest.case import OESelftestTestCase
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/sstate.py b/poky/meta/lib/oeqa/selftest/cases/sstate.py
index 80ce9e3..1767663 100644
--- a/poky/meta/lib/oeqa/selftest/cases/sstate.py
+++ b/poky/meta/lib/oeqa/selftest/cases/sstate.py
@@ -3,14 +3,11 @@
 #
 
 import datetime
-import unittest
 import os
 import re
-import shutil
 
-import oeqa.utils.ftools as ftools
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_vars, get_test_layer
+from oeqa.utils.commands import get_bb_vars
 
 
 class SStateBase(OESelftestTestCase):
diff --git a/poky/meta/lib/oeqa/selftest/cases/sstatetests.py b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py
index 3038b40..4a32af9 100644
--- a/poky/meta/lib/oeqa/selftest/cases/sstatetests.py
+++ b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -8,8 +8,7 @@
 import subprocess
 import tempfile
 
-from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer, create_temp_layer
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
 from oeqa.selftest.cases.sstate import SStateBase
 import oe
 
diff --git a/poky/meta/lib/oeqa/selftest/cases/sysroot.py b/poky/meta/lib/oeqa/selftest/cases/sysroot.py
index 79ab452..315d1a6 100644
--- a/poky/meta/lib/oeqa/selftest/cases/sysroot.py
+++ b/poky/meta/lib/oeqa/selftest/cases/sysroot.py
@@ -5,7 +5,7 @@
 import uuid
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import  bitbake
+from oeqa.utils.commands import bitbake
 
 class SysrootTests(OESelftestTestCase):
     def test_sysroot_cleanup(self):
diff --git a/poky/meta/lib/oeqa/selftest/cases/tinfoil.py b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
index 6f26af2..c81d56d 100644
--- a/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
+++ b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
@@ -9,7 +9,6 @@
 import bb.tinfoil
 
 from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import runCmd
 
 class TinfoilTests(OESelftestTestCase):
     """ Basic tests for the tinfoil API """
diff --git a/poky/meta/lib/oeqa/selftest/cases/wic.py b/poky/meta/lib/oeqa/selftest/cases/wic.py
index 6f3dc27..de74c07 100644
--- a/poky/meta/lib/oeqa/selftest/cases/wic.py
+++ b/poky/meta/lib/oeqa/selftest/cases/wic.py
@@ -19,29 +19,26 @@
 from tempfile import NamedTemporaryFile
 
 from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator import OETestTag
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
 
 
-@lru_cache(maxsize=32)
-def get_host_arch(recipe):
-    """A cached call to get_bb_var('HOST_ARCH', <recipe>)"""
-    return get_bb_var('HOST_ARCH', recipe)
+@lru_cache()
+def get_host_arch():
+    return get_bb_var('HOST_ARCH')
 
 
-def only_for_arch(archs, image='core-image-minimal'):
+def only_for_arch(archs):
     """Decorator for wrapping test cases that can be run only for specific target
     architectures. A list of compatible architectures is passed in `archs`.
-    Current architecture will be determined by parsing bitbake output for
-    `image` recipe.
     """
     def wrapper(func):
         @wraps(func)
         def wrapped_f(*args, **kwargs):
-            arch = get_host_arch(image)
+            arch = get_host_arch()
             if archs and arch not in archs:
                 raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
             return func(*args, **kwargs)
-        wrapped_f.__name__ = func.__name__
         return wrapped_f
     return wrapper
 
@@ -78,22 +75,18 @@
 
     def setUpLocal(self):
         """This code is executed before each test method."""
-        self.resultdir = self.builddir + "/wic-tmp/"
+        self.resultdir = os.path.join(self.builddir, "wic-tmp")
         super(WicTestCase, self).setUpLocal()
 
         # Do this here instead of in setUpClass as the base setUp does some
         # clean up which can result in the native tools built earlier in
         # setUpClass being unavailable.
         if not WicTestCase.image_is_ready:
-            if get_bb_var('USE_NLS') == 'yes':
-                bitbake('wic-tools')
-            else:
-                self.skipTest('wic-tools cannot be built due its (intltool|gettext)-native dependency and NLS disable')
+            if self.td['USE_NLS'] != 'yes':
+                self.skipTest('wic-tools needs USE_NLS=yes')
 
-            bitbake('core-image-minimal')
-            bitbake('core-image-minimal-mtdutils')
+            bitbake('wic-tools core-image-minimal core-image-minimal-mtdutils')
             WicTestCase.image_is_ready = True
-
         rmtree(self.resultdir, ignore_errors=True)
 
     def tearDownLocal(self):
@@ -104,15 +97,13 @@
     def _get_image_env_path(self, image):
         """Generate and obtain the path to <image>.env"""
         if image not in WicTestCase.wicenv_cache:
-            self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
-            bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image)
-            stdir = bb_vars['STAGING_DIR']
-            machine = bb_vars['MACHINE']
+            bitbake('%s -c do_rootfs_wicenv' % image)
+            stdir = get_bb_var('STAGING_DIR', image)
+            machine = self.td["MACHINE"]
             WicTestCase.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
         return WicTestCase.wicenv_cache[image]
 
-class Wic(WicTestCase):
-
+class CLITests(OESelftestTestCase):
     def test_version(self):
         """Test wic --version"""
         runCmd('wic --version')
@@ -173,18 +164,19 @@
         """Test wic without command"""
         self.assertEqual(1, runCmd('wic', ignore_status=True).status)
 
+class Wic(WicTestCase):
     def test_build_image_name(self):
         """Test wic create wictestdisk --image-name=core-image-minimal"""
         cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join (self.resultdir, "wictestdisk-*.direct"))))
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_gpt_image(self):
         """Test creation of core-image-minimal with gpt table and UUID boot"""
         cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-*.direct"))))
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_iso_image(self):
@@ -197,22 +189,22 @@
         self.remove_config(config)
         cmd = "wic create mkhybridiso --image-name core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "HYBRID_ISO_IMG-*.direct"))))
+        self.assertEqual(1, len(glob(os.path.join (self.resultdir, "HYBRID_ISO_IMG-*.iso"))))
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_qemux86_directdisk(self):
         """Test creation of qemux-86-directdisk image"""
         cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "qemux86-directdisk-*direct"))))
 
-    @only_for_arch(['i586', 'i686', 'x86_64'])
+    @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
     def test_mkefidisk(self):
         """Test creation of mkefidisk image"""
         cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "mkefidisk-*direct"))))
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_bootloader_config(self):
@@ -223,9 +215,9 @@
         self.remove_config(config)
         cmd = "wic create directdisk-bootloader-config -e core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-bootloader-config-*direct"))))
 
-    @only_for_arch(['i586', 'i686', 'x86_64'])
+    @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
     def test_systemd_bootdisk(self):
         """Test creation of systemd-bootdisk image"""
         config = 'MACHINE_FEATURES:append = " efi"\n'
@@ -234,7 +226,7 @@
         self.remove_config(config)
         cmd = "wic create systemd-bootdisk -e core-image-minimal -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "systemd-bootdisk-*direct"))))
 
     def test_efi_bootpart(self):
         """Test creation of efi-bootpart image"""
@@ -243,7 +235,7 @@
         self.append_config('IMAGE_EFI_BOOT_FILES = "%s;kernel"\n' % kimgtype)
         runCmd(cmd)
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-        images = glob(self.resultdir + "mkefidisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
         result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))       
         self.assertIn("kernel",result.output)
 
@@ -253,8 +245,9 @@
         kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
         self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "sdimage-bootpart-*direct"))))
 
+    # TODO this doesn't have to be x86-specific
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_default_output_dir(self):
         """Test default output location"""
@@ -283,28 +276,28 @@
                         "-n %(recipe_sysroot_native)s "
                         "-r %(image_rootfs)s "
                         "-o %(resultdir)s" % bbvars)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-*.direct"))))
 
     def test_compress_gzip(self):
         """Test compressing an image with gzip"""
         runCmd("wic create wictestdisk "
                                    "--image-name core-image-minimal "
                                    "-c gzip -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.gz"))))
 
     def test_compress_bzip2(self):
         """Test compressing an image with bzip2"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-c bzip2 -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.bz2"))))
 
     def test_compress_xz(self):
         """Test compressing an image with xz"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "--compress-with=xz -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.xz"))))
 
     def test_wrong_compressor(self):
         """Test how wic breaks if wrong compressor is provided"""
@@ -318,23 +311,23 @@
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "tmp.wic*"))))
 
     def test_debug_long(self):
         """Test --debug option"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "--debug -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "tmp.wic*")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "tmp.wic*"))))
 
     def test_skip_build_check_short(self):
         """Test -s option"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-s -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_skip_build_check_long(self):
         """Test --skip-build-check option"""
@@ -342,14 +335,14 @@
                                    "--image-name=core-image-minimal "
                                    "--skip-build-check "
                                    "--outdir %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_build_rootfs_short(self):
         """Test -f option"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-f -o %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_build_rootfs_long(self):
         """Test --build-rootfs option"""
@@ -357,8 +350,9 @@
                                    "--image-name=core-image-minimal "
                                    "--build-rootfs "
                                    "--outdir %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
+    # TODO this doesn't have to be x86-specific
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_rootfs_indirect_recipes(self):
         """Test usage of rootfs plugin with rootfs recipes"""
@@ -367,8 +361,9 @@
                         "--rootfs rootfs1=core-image-minimal "
                         "--rootfs rootfs2=core-image-minimal "
                         "--outdir %s" % self.resultdir)
-        self.assertEqual(1, len(glob(self.resultdir + "directdisk-multi-rootfs*.direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-multi-rootfs*.direct"))))
 
+    # TODO this doesn't have to be x86-specific
     @only_for_arch(['i586', 'i686', 'x86_64'])
     def test_rootfs_artifacts(self):
         """Test usage of rootfs plugin with rootfs paths"""
@@ -386,7 +381,7 @@
                         "--rootfs-dir rootfs1=%(image_rootfs)s "
                         "--rootfs-dir rootfs2=%(image_rootfs)s "
                         "--outdir %(resultdir)s" % bbvars)
-        self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars)))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "%(wks)s-*.direct" % bbvars))))
 
     def test_exclude_path(self):
         """Test --exclude-path wks option."""
@@ -407,7 +402,7 @@
                                        % (wks_file, self.resultdir))
 
             os.remove(wks_file)
-            wicout = glob(self.resultdir + "%s-*direct" % 'temp')
+            wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp'))
             self.assertEqual(1, len(wicout))
 
             wicimg = wicout[0]
@@ -694,8 +689,8 @@
         os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
 
         # Get stock fstab from base-files recipe
-        self.assertEqual(0, bitbake('base-files -c do_install').status)
-        bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc/fstab')
+        bitbake('base-files -c do_install')
+        bf_fstab = os.path.join(get_bb_var('D', 'base-files'), 'etc', 'fstab')
         self.assertEqual(True, os.path.exists(bf_fstab))
         bf_fstab_md5sum = runCmd('md5sum %s 2>/dev/null' % bf_fstab).output.split(" ")[0]
 
@@ -750,7 +745,7 @@
         runCmd("wic create wictestdisk "
                                    "--image-name core-image-minimal "
                                    "--extra-space %i -o %s" % (extraspace ,self.resultdir))
-        wicout = glob(self.resultdir + "wictestdisk-*.direct")
+        wicout = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(wicout))
         size = os.path.getsize(wicout[0])
         self.assertTrue(size > extraspace)
@@ -761,15 +756,15 @@
         """Test generation of .bmap file -m option"""
         cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct.bmap"))))
 
     def test_bmap_long(self):
         """Test generation of .bmap file --bmap option"""
         cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir
         runCmd(cmd)
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct.bmap"))))
 
     def test_image_env(self):
         """Test generation of <image>.env files."""
@@ -805,7 +800,7 @@
                                    "--image-name=%s -v %s -n %s -o %s"
                                    % (image, imgenvdir, native_sysroot,
                                       self.resultdir))
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
 
     def test_image_vars_dir_long(self):
         """Test image vars directory selection --vars option"""
@@ -820,20 +815,19 @@
                                    "--outdir %s"
                                    % (image, imgenvdir, native_sysroot,
                                       self.resultdir))
-        self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
 
-    @only_for_arch(['i586', 'i686', 'x86_64'])
+    @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
     def test_wic_image_type(self):
         """Test building wic images by bitbake"""
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('wic-image-minimal').status)
+        bitbake('wic-image-minimal')
         self.remove_config(config)
 
-        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
-        deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
-        machine = bb_vars['MACHINE']
+        deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+        machine = self.td['MACHINE']
         prefix = os.path.join(deploy_dir, 'wic-image-minimal-%s.' % machine)
         # check if we have result image and manifests symlinks
         # pointing to existing files
@@ -842,13 +836,15 @@
             self.assertTrue(os.path.islink(path))
             self.assertTrue(os.path.isfile(os.path.realpath(path)))
 
+    # TODO this should work on aarch64
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_qemu(self):
         """Test wic-image-minimal under qemu"""
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('wic-image-minimal').status)
+        bitbake('wic-image-minimal')
         self.remove_config(config)
 
         with runqemu('wic-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
@@ -863,11 +859,12 @@
             self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0')
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_qemu_efi(self):
         """Test core-image-minimal efi image under qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal ovmf').status)
+        bitbake('core-image-minimal ovmf')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -900,7 +897,7 @@
 
         wksname = os.path.splitext(os.path.basename(wkspath))[0]
 
-        wicout = glob(self.resultdir + "%s-*direct" % wksname)
+        wicout = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
 
         if not wicout:
             return (p, None)
@@ -1045,18 +1042,19 @@
             size = int(size[:-3])
             self.assertGreaterEqual(size, 204800)
 
-    @only_for_arch(['i586', 'i686', 'x86_64'])
+    @only_for_arch(['i586', 'i686', 'x86_64', 'aarch64'])
+    @OETestTag("runqemu")
     def test_rawcopy_plugin_qemu(self):
         """Test rawcopy plugin in qemu"""
         # build ext4 and then use it for a wic image
         config = 'IMAGE_FSTYPES = "ext4"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal-mtdutils').status)
+        bitbake('core-image-minimal-mtdutils')
         self.remove_config(config)
 
         with runqemu('core-image-minimal-mtdutils', ssh=False,
@@ -1069,7 +1067,7 @@
     def _rawcopy_plugin(self, fstype):
         """Test rawcopy plugin"""
         img = 'core-image-minimal'
-        machine = get_bb_var('MACHINE', img)
+        machine = self.td["MACHINE"]
         params = ',unpack' if fstype.endswith('.gz') else ''
         with NamedTemporaryFile("w", suffix=".wks") as wks:
             wks.write('part / --source rawcopy --sourceparams="file=%s-%s.%s%s"\n'\
@@ -1078,7 +1076,7 @@
             cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
-            out = glob(self.resultdir + "%s-*direct" % wksname)
+            out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
             self.assertEqual(1, len(out))
 
     def test_rawcopy_plugin(self):
@@ -1096,14 +1094,13 @@
         """Test empty plugin"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_empty_plugin.wks"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
+        deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+        machine = self.td['MACHINE']
 
-        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
-        deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
-        machine = bb_vars['MACHINE']
         image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine)
-        self.assertEqual(True, os.path.exists(image_path))
+        self.assertTrue(os.path.exists(image_path))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
@@ -1113,11 +1110,12 @@
         self.assertEqual('1', result.output)
 
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_biosplusefi_plugin_qemu(self):
         """Test biosplusefi plugin in qemu"""
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -1155,7 +1153,7 @@
         # The easiest way to work-around this issue is to make sure we already built an image here, hence the bitbake call
         config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "test_biosplusefi_plugin.wks"\nMACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
+        bitbake('core-image-minimal')
         self.remove_config(config)
 
         img = 'core-image-minimal'
@@ -1167,10 +1165,12 @@
             cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
-            out = glob(self.resultdir + "%s-*.direct" % wksname)
+            out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
             self.assertEqual(1, len(out))
 
+    # TODO this test could also work on aarch64
     @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
     def test_efi_plugin_unified_kernel_image_qemu(self):
         """Test efi plugin's Unified Kernel Image feature in qemu"""
         config = 'IMAGE_FSTYPES = "wic"\n'\
@@ -1178,7 +1178,7 @@
                  'WKS_FILE = "test_efi_plugin.wks"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal core-image-minimal-initramfs ovmf').status)
+        bitbake('core-image-minimal core-image-minimal-initramfs ovmf')
         self.remove_config(config)
 
         with runqemu('core-image-minimal', ssh=False,
@@ -1215,7 +1215,7 @@
             cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
-            out = glob(self.resultdir + "%s-*direct" % wksname)
+            out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
             self.assertEqual(1, len(out))
 
     def test_kickstart_parser(self):
@@ -1227,7 +1227,7 @@
             cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
-            out = glob(self.resultdir + "%s-*direct" % wksname)
+            out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
             self.assertEqual(1, len(out))
 
     def test_image_bootpart_globbed(self):
@@ -1238,11 +1238,11 @@
         self.append_config(config)
         runCmd(cmd)
         self.remove_config(config)
-        self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+        self.assertEqual(1, len(glob(os.path.join(self.resultdir, "sdimage-bootpart-*direct"))))
 
     def test_sparse_copy(self):
         """Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs"""
-        libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'wic')
+        libpath = os.path.join(self.td['COREBASE'], 'scripts', 'lib', 'wic')
         sys.path.insert(0, libpath)
         from  filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp
         with NamedTemporaryFile("w", suffix=".wic-sparse") as sparse:
@@ -1268,12 +1268,86 @@
                 self.assertEqual(dest_stat.st_blocks, 8)
             os.unlink(dest)
 
+    def test_mkfs_extraopts(self):
+        """Test wks option --mkfs-extraopts for empty and not empty partitions"""
+        img = 'core-image-minimal'
+        with NamedTemporaryFile("w", suffix=".wks") as wks:
+            wks.writelines(
+                ['part ext2   --fstype ext2     --source rootfs --mkfs-extraopts "-D -F -i 8192"\n',
+                 "part btrfs  --fstype btrfs    --source rootfs --size 40M --mkfs-extraopts='--quiet'\n",
+                 'part squash --fstype squashfs --source rootfs --mkfs-extraopts "-no-sparse -b 4096"\n',
+                 'part emptyvfat   --fstype vfat   --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
+                 'part emptymsdos  --fstype msdos  --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
+                 'part emptyext2   --fstype ext2   --size 1M --mkfs-extraopts "-D -F -i 8192"\n',
+                 'part emptybtrfs  --fstype btrfs  --size 100M --mkfs-extraopts "--mixed -K"\n'])
+            wks.flush()
+            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            runCmd(cmd)
+            wksname = os.path.splitext(os.path.basename(wks.name))[0]
+            out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
+            self.assertEqual(1, len(out))
+
+    @only_for_arch(['i586', 'i686', 'x86_64'])
+    @OETestTag("runqemu")
+    def test_expand_mbr_image(self):
+        """Test wic write --expand command for mbr image"""
+        # build an image
+        config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n'
+        self.append_config(config)
+        bitbake('core-image-minimal')
+
+        # get path to the image
+        deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+        machine = self.td['MACHINE']
+        image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine)
+
+        self.remove_config(config)
+
+        try:
+            # expand image to 1G
+            new_image_path = None
+            with NamedTemporaryFile(mode='wb', suffix='.wic.exp',
+                                    dir=deploy_dir, delete=False) as sparse:
+                sparse.truncate(1024 ** 3)
+                new_image_path = sparse.name
+
+            sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+            cmd = "wic write -n %s --expand 1:0 %s %s" % (sysroot, image_path, new_image_path)
+            runCmd(cmd)
+
+            # check if partitions are expanded
+            orig = runCmd("wic ls %s -n %s" % (image_path, sysroot))
+            exp = runCmd("wic ls %s -n %s" % (new_image_path, sysroot))
+            orig_sizes = [int(line.split()[3]) for line in orig.output.split('\n')[1:]]
+            exp_sizes = [int(line.split()[3]) for line in exp.output.split('\n')[1:]]
+            self.assertEqual(orig_sizes[0], exp_sizes[0]) # first partition is not resized
+            self.assertTrue(orig_sizes[1] < exp_sizes[1])
+
+            # Check if all free space is partitioned
+            result = runCmd("%s/usr/sbin/sfdisk -F %s" % (sysroot, new_image_path))
+            self.assertTrue("0 B, 0 bytes, 0 sectors" in result.output)
+
+            os.rename(image_path, image_path + '.bak')
+            os.rename(new_image_path, image_path)
+
+            # Check if it boots in qemu
+            with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
+                cmd = "ls /etc/"
+                status, output = qemu.run_serial('true')
+                self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+        finally:
+            if os.path.exists(new_image_path):
+                os.unlink(new_image_path)
+            if os.path.exists(image_path + '.bak'):
+                os.rename(image_path + '.bak', image_path)
+
+class ModifyTests(WicTestCase):
     def test_wic_ls(self):
         """Test listing image content using 'wic ls'"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "wictestdisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
@@ -1291,7 +1365,7 @@
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "wictestdisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
@@ -1337,105 +1411,35 @@
         runCmd("wic create mkefidisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "mkefidisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+        # Not bulletproof but hopefully sufficient
+        kerneltype = get_bb_var('KERNEL_IMAGETYPE', 'virtual/kernel')
 
         # list directory content of the first partition
         result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
-        self.assertIn('\nBZIMAGE        ', result.output)
+        self.assertIn('\n%s        ' % kerneltype.upper(), result.output)
         self.assertIn('\nEFI          <DIR>     ', result.output)
 
-        # remove file
-        runCmd("wic rm %s:1/bzimage -n %s" % (images[0], sysroot))
+        # remove file. EFI partitions are case-insensitive so exercise that too
+        runCmd("wic rm %s:1/%s -n %s" % (images[0], kerneltype.lower(), sysroot))
 
         # remove directory
         runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
 
         # check if they're removed
         result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
-        self.assertNotIn('\nBZIMAGE        ', result.output)
+        self.assertNotIn('\n%s        ' % kerneltype.upper(), result.output)
         self.assertNotIn('\nEFI          <DIR>     ', result.output)
 
-    def test_mkfs_extraopts(self):
-        """Test wks option --mkfs-extraopts for empty and not empty partitions"""
-        img = 'core-image-minimal'
-        with NamedTemporaryFile("w", suffix=".wks") as wks:
-            wks.writelines(
-                ['part ext2   --fstype ext2     --source rootfs --mkfs-extraopts "-D -F -i 8192"\n',
-                 "part btrfs  --fstype btrfs    --source rootfs --size 40M --mkfs-extraopts='--quiet'\n",
-                 'part squash --fstype squashfs --source rootfs --mkfs-extraopts "-no-sparse -b 4096"\n',
-                 'part emptyvfat   --fstype vfat   --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
-                 'part emptymsdos  --fstype msdos  --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
-                 'part emptyext2   --fstype ext2   --size 1M --mkfs-extraopts "-D -F -i 8192"\n',
-                 'part emptybtrfs  --fstype btrfs  --size 100M --mkfs-extraopts "--mixed -K"\n'])
-            wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
-            runCmd(cmd)
-            wksname = os.path.splitext(os.path.basename(wks.name))[0]
-            out = glob(self.resultdir + "%s-*direct" % wksname)
-            self.assertEqual(1, len(out))
-
-    def test_expand_mbr_image(self):
-        """Test wic write --expand command for mbr image"""
-        # build an image
-        config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n'
-        self.append_config(config)
-        self.assertEqual(0, bitbake('core-image-minimal').status)
-
-        # get path to the image
-        bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
-        deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
-        machine = bb_vars['MACHINE']
-        image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine)
-
-        self.remove_config(config)
-
-        try:
-            # expand image to 1G
-            new_image_path = None
-            with NamedTemporaryFile(mode='wb', suffix='.wic.exp',
-                                    dir=deploy_dir, delete=False) as sparse:
-                sparse.truncate(1024 ** 3)
-                new_image_path = sparse.name
-
-            sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-            cmd = "wic write -n %s --expand 1:0 %s %s" % (sysroot, image_path, new_image_path)
-            runCmd(cmd)
-
-            # check if partitions are expanded
-            orig = runCmd("wic ls %s -n %s" % (image_path, sysroot))
-            exp = runCmd("wic ls %s -n %s" % (new_image_path, sysroot))
-            orig_sizes = [int(line.split()[3]) for line in orig.output.split('\n')[1:]]
-            exp_sizes = [int(line.split()[3]) for line in exp.output.split('\n')[1:]]
-            self.assertEqual(orig_sizes[0], exp_sizes[0]) # first partition is not resized
-            self.assertTrue(orig_sizes[1] < exp_sizes[1])
-
-            # Check if all free space is partitioned
-            result = runCmd("%s/usr/sbin/sfdisk -F %s" % (sysroot, new_image_path))
-            self.assertTrue("0 B, 0 bytes, 0 sectors" in result.output)
-
-            bb.utils.rename(image_path, image_path + '.bak')
-            bb.utils.rename(new_image_path, image_path)
-
-            # Check if it boots in qemu
-            with runqemu('core-image-minimal', ssh=False, runqemuparams='nographic') as qemu:
-                cmd = "ls /etc/"
-                status, output = qemu.run_serial('true')
-                self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
-        finally:
-            if os.path.exists(new_image_path):
-                os.unlink(new_image_path)
-            if os.path.exists(image_path + '.bak'):
-                bb.utils.rename(image_path + '.bak', image_path)
-
     def test_wic_ls_ext(self):
         """Test listing content of the ext partition using 'wic ls'"""
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "wictestdisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
@@ -1450,7 +1454,7 @@
         runCmd("wic create wictestdisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "wictestdisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
@@ -1486,7 +1490,7 @@
         runCmd("wic create mkefidisk "
                                    "--image-name=core-image-minimal "
                                    "-D -o %s" % self.resultdir)
-        images = glob(self.resultdir + "mkefidisk-*.direct")
+        images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')