]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/core/decorator: add skipIfFeature
authorAndré Draszik <git@andred.net>
Wed, 16 Oct 2019 09:18:23 +0000 (10:18 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 19 Oct 2019 17:13:38 +0000 (18:13 +0100)
skipIfFeature will skip a test if a given DIST_FEATURE
or IMAGE_FEATURE is enabled.

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/decorator/data.py

index babc9789d624e2fe5680ad56bb426bcdb9715a17..12d462f2029801bba87921a801cfbcc92e0cf316 100644 (file)
@@ -113,3 +113,21 @@ class skipIfNotFeature(OETestDecorator):
         self.logger.debug(msg)
         if not has_feature(self.case.td, self.value):
             self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfFeature(OETestDecorator):
+    """
+        Skip test based on DISTRO_FEATURES.
+
+        value must not be in distro features or it will skip the test
+        with msg as the reason.
+    """
+
+    attrs = ('value', 'msg')
+
+    def setUpDecorator(self):
+        msg = ('Checking if %s is not in DISTRO_FEATURES '
+               'or IMAGE_FEATURES' % (self.value))
+        self.logger.debug(msg)
+        if has_feature(self.case.td, self.value):
+            self.case.skipTest(self.msg)