summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/decorator/data.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index 12d462f202..ff92fba57a 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -18,6 +18,16 @@ def has_feature(td, feature):
18 return True 18 return True
19 return False 19 return False
20 20
21def has_machine(td, machine):
22 """
23 Checks for MACHINE.
24 """
25
26 if (machine in td.get('MACHINE', '')):
27 return True
28 return False
29
30
21@registerDecorator 31@registerDecorator
22class skipIfDataVar(OETestDecorator): 32class skipIfDataVar(OETestDecorator):
23 """ 33 """
@@ -131,3 +141,37 @@ class skipIfFeature(OETestDecorator):
131 self.logger.debug(msg) 141 self.logger.debug(msg)
132 if has_feature(self.case.td, self.value): 142 if has_feature(self.case.td, self.value):
133 self.case.skipTest(self.msg) 143 self.case.skipTest(self.msg)
144
145@registerDecorator
146class skipIfNotMachine(OETestDecorator):
147 """
148 Skip test based on MACHINE.
149
150 value must be match MACHINE or it will skip the test
151 with msg as the reason.
152 """
153
154 attrs = ('value', 'msg')
155
156 def setUpDecorator(self):
157 msg = ('Checking if %s is not this MACHINE' % self.value)
158 self.logger.debug(msg)
159 if not has_machine(self.case.td, self.value):
160 self.case.skipTest(self.msg)
161
162@registerDecorator
163class skipIfMachine(OETestDecorator):
164 """
165 Skip test based on Machine.
166
167 value must not be this machine or it will skip the test
168 with msg as the reason.
169 """
170
171 attrs = ('value', 'msg')
172
173 def setUpDecorator(self):
174 msg = ('Checking if %s is this MACHINE' % self.value)
175 self.logger.debug(msg)
176 if has_machine(self.case.td, self.value):
177 self.case.skipTest(self.msg)