aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-12-12 10:12:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:20 +0000
commit41b0b31a84254d75b4cca8d5f61c680bda5dd926 (patch)
tree613215de6abab418bcb26a3a57599f5da395fa13 /meta/lib
parentc35b42cdbbdc5d966fc9e4c0173273189f50c9c0 (diff)
downloadopenembedded-core-contrib-41b0b31a84254d75b4cca8d5f61c680bda5dd926.tar.gz
oeqa/core/decorator: Add skipIfNotDataVar and skipIfNotInDataVar
skipIfNotDataVar will skip a test if a variable doesn't have certain value. skipIfNotInDataVar will skip a test if a value is not in a certain variable. (From OE-Core rev: a81045f4e2b740173237f5ae4e80e2bc0b287faa) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/core/decorator/data.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/meta/lib/oeqa/core/decorator/data.py b/meta/lib/oeqa/core/decorator/data.py
index fdeba9fe1d..ff7bdd98b7 100644
--- a/meta/lib/oeqa/core/decorator/data.py
+++ b/meta/lib/oeqa/core/decorator/data.py
@@ -28,12 +28,46 @@ class skipIfDataVar(OETestDecorator):
attrs = ('var', 'value', 'msg')
def setUpDecorator(self):
- msg = 'Checking if %r value is %r to skip test' % (self.var, self.value)
+ msg = ('Checking if %r value is %r to skip test' %
+ (self.var, self.value))
self.logger.debug(msg)
if self.case.td.get(self.var) == self.value:
self.case.skipTest(self.msg)
@registerDecorator
+class skipIfNotDataVar(OETestDecorator):
+ """
+ Skip test based on value of a data store's variable.
+
+ It will get the info of var from the data store and will
+ check it against value; if are not equal it will skip the
+ test with msg as the reason.
+ """
+
+ attrs = ('var', 'value', 'msg')
+
+ def setUpDecorator(self):
+ msg = ('Checking if %r value is not %r to skip test' %
+ (self.var, self.value))
+ self.logger.debug(msg)
+ if not self.case.td.get(self.var) == self.value:
+ self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfNotInDataVar(OETestDecorator):
+ """
+ Skip test if value is not in data store's variable.
+ """
+
+ attrs = ('var', 'value', 'msg')
+ def setUpDecorator(self):
+ msg = ('Checking if %r value is in %r to run '
+ 'the test' % (self.var, self.value))
+ self.logger.debug(msg)
+ if not self.value in self.case.td.get(self.var):
+ self.case.skipTest(self.msg)
+
+@registerDecorator
class OETestDataDepends(OETestDecorator):
attrs = ('td_depends',)