summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-11-11 20:33:21 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-14 13:21:00 +0000
commit97c2021b8a8728811910ed9641658d9f2824d353 (patch)
treea3c956b58136624d46383a1002d0005413eefcdc /meta/lib
parent1351614b8db8ae510f49b2a1a2007408ce7840a5 (diff)
downloadpoky-97c2021b8a8728811910ed9641658d9f2824d353.tar.gz
oeqa/core: Add qemu checks
Some test should not be run in QEMU systems so add some checks to make that easier (From OE-Core rev: 1b1e53c4ad33a71d526887d1133598f255a476ec) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/core/decorator/data.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index ff92fba57a..bc4939e87c 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):
27 return True 27 return True
28 return False 28 return False
29 29
30def is_qemu(td, qemu):
31 """
32 Checks if MACHINE is qemu.
33 """
34
35 machine = td.get('MACHINE', '')
36 if (qemu in td.get('MACHINE', '') or
37 machine.startswith('qemu')):
38 return True
39 return False
30 40
31@registerDecorator 41@registerDecorator
32class skipIfDataVar(OETestDecorator): 42class skipIfDataVar(OETestDecorator):
@@ -175,3 +185,38 @@ class skipIfMachine(OETestDecorator):
175 self.logger.debug(msg) 185 self.logger.debug(msg)
176 if has_machine(self.case.td, self.value): 186 if has_machine(self.case.td, self.value):
177 self.case.skipTest(self.msg) 187 self.case.skipTest(self.msg)
188
189@registerDecorator
190class skipIfNotQemu(OETestDecorator):
191 """
192 Skip test based on MACHINE.
193
194 value must be a qemu MACHINE or it will skip the test
195 with msg as the reason.
196 """
197
198 attrs = ('value', 'msg')
199
200 def setUpDecorator(self):
201 msg = ('Checking if %s is not this MACHINE' % self.value)
202 self.logger.debug(msg)
203 if not is_qemu(self.case.td, self.value):
204 self.case.skipTest(self.msg)
205
206@registerDecorator
207class skipIfQemu(OETestDecorator):
208 """
209 Skip test based on Qemu Machine.
210
211 value must not be a qemu machine or it will skip the test
212 with msg as the reason.
213 """
214
215 attrs = ('value', 'msg')
216
217 def setUpDecorator(self):
218 msg = ('Checking if %s is this MACHINE' % self.value)
219 self.logger.debug(msg)
220 if is_qemu(self.case.td, self.value):
221 self.case.skipTest(self.msg)
222