summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/decorator/data.py44
1 files changed, 9 insertions, 35 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index 12197be246..3ce10e5499 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -27,17 +27,6 @@ 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
40
41@registerDecorator 30@registerDecorator
42class skipIfDataVar(OETestDecorator): 31class skipIfDataVar(OETestDecorator):
43 """ 32 """
@@ -189,34 +178,19 @@ class skipIfMachine(OETestDecorator):
189@registerDecorator 178@registerDecorator
190class skipIfNotQemu(OETestDecorator): 179class skipIfNotQemu(OETestDecorator):
191 """ 180 """
192 Skip test based on MACHINE. 181 Skip test if MACHINE is not qemu*
193
194 value must be a qemu MACHINE or it will skip the test
195 with msg as the reason.
196 """ 182 """
197
198 attrs = ('value', 'msg')
199
200 def setUpDecorator(self): 183 def setUpDecorator(self):
201 msg = ('Checking if %s is not this MACHINE' % self.value) 184 self.logger.debug("Checking if not qemu MACHINE")
202 self.logger.debug(msg) 185 if not self.case.td.get('MACHINE', '').startswith('qemu'):
203 if not is_qemu(self.case.td, self.value): 186 self.case.skipTest('Test only runs on qemu machines')
204 self.case.skipTest(self.msg)
205 187
206@registerDecorator 188@registerDecorator
207class skipIfQemu(OETestDecorator): 189class skipIfQemu(OETestDecorator):
208 """ 190 """
209 Skip test based on Qemu Machine. 191 Skip test if MACHINE is qemu*
210 192 """
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): 193 def setUpDecorator(self):
218 msg = ('Checking if %s is this MACHINE' % self.value) 194 self.logger.debug("Checking if qemu MACHINE")
219 self.logger.debug(msg) 195 if self.case.td.get('MACHINE', '').startswith('qemu'):
220 if is_qemu(self.case.td, self.value): 196 self.case.skipTest('Test only runs on real hardware')
221 self.case.skipTest(self.msg)
222