From: Adrian Freihofer Date: Thu, 7 Dec 2023 20:52:50 +0000 (+0100) Subject: oeqa/core/decorator: add skip if not qemu-usermode X-Git-Tag: uninative-4.4~750 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d79615d6c9ccb1ff3766ce05389bc22cbd656e1;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git oeqa/core/decorator: add skip if not qemu-usermode Add a decorator to skip tests which require the qemu-usermode machine feature. Signed-off-by: Adrian Freihofer Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py index de881e097ab..5444b2cb751 100644 --- a/meta/lib/oeqa/core/decorator/data.py +++ b/meta/lib/oeqa/core/decorator/data.py @@ -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): """