]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/core/decorator: add skip if not qemu-usermode
authorAdrian Freihofer <adrian.freihofer@gmail.com>
Thu, 7 Dec 2023 20:52:50 +0000 (21:52 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 13 Dec 2023 11:58:12 +0000 (11:58 +0000)
Add a decorator to skip tests which require the qemu-usermode machine
feature.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/decorator/data.py

index de881e097ab14d31e25550992b980c06bb7cf98c..5444b2cb751836a7baa4ed4a53d629b007464c77 100644 (file)
@@ -185,6 +185,16 @@ class skipIfNotQemu(OETestDecorator):
         if not self.case.td.get('MACHINE', '').startswith('qemu'):
             self.case.skipTest('Test only runs on qemu machines')
 
+@registerDecorator
+class skipIfNotQemuUsermode(OETestDecorator):
+    """
+    Skip test if MACHINE_FEATURES does not contain qemu-usermode
+    """
+    def setUpDecorator(self):
+        self.logger.debug("Checking if MACHINE_FEATURES does not contain qemu-usermode")
+        if 'qemu-usermode' not in self.case.td.get('MACHINE_FEATURES', '').split():
+            self.case.skipTest('Test requires qemu-usermode in MACHINE_FEATURES')
+
 @registerDecorator
 class skipIfQemu(OETestDecorator):
     """