[oe-commits] [openembedded-core] 10/39: OEQA: Add qemu checks
git at git.openembedded.org
git at git.openembedded.org
Wed Nov 13 22:48:44 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 50dfbf518d7b7f8ee70e1a4011ae48e433b1cc30
Author: Armin Kuster <akuster808 at gmail.com>
AuthorDate: Mon Nov 11 20:33:21 2019 -0800
OEQA: Add qemu checks
Some test should not be run in QEMU systems so
add some checks to make that easier
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/core/decorator/data.py | 45 ++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index ff92fba..bc4939e 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -27,6 +27,16 @@ def has_machine(td, 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')):
+ return True
+ return False
@registerDecorator
class skipIfDataVar(OETestDecorator):
@@ -175,3 +185,38 @@ class skipIfMachine(OETestDecorator):
self.logger.debug(msg)
if has_machine(self.case.td, self.value):
self.case.skipTest(self.msg)
+
+ at 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.
+ """
+
+ 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)
+
+ at 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')
+
+ 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)
+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list