summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/decorator
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-11-09 11:14:23 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:18 +0000
commitb8cebdb96cdda0a8b4b3d5f638798d0ec54e3a14 (patch)
tree51b2490bd36b0c4c6b25753638a4a1058b7cb53a /meta/lib/oeqa/core/decorator
parent95a2ec6aab25a666a7163e7ddb9fcbf51bfa4c7e (diff)
downloadpoky-b8cebdb96cdda0a8b4b3d5f638798d0ec54e3a14.tar.gz
oeqa/core/decorator: Add support for OETestID and OETestTag
These two decorators stores certain TAG or ID for the test case also provides support for filtering in loading step. [YOCTO #10236] (From OE-Core rev: 047af4ce864bbf98e2617b348ae9ccb77ac52871) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/decorator')
-rw-r--r--meta/lib/oeqa/core/decorator/oeid.py23
-rw-r--r--meta/lib/oeqa/core/decorator/oetag.py24
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/decorator/oeid.py b/meta/lib/oeqa/core/decorator/oeid.py
new file mode 100644
index 0000000000..ea8017a55a
--- /dev/null
+++ b/meta/lib/oeqa/core/decorator/oeid.py
@@ -0,0 +1,23 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from . import OETestFilter, registerDecorator
5from oeqa.core.utils.misc import intToList
6
7def _idFilter(oeid, filters):
8 return False if oeid in filters else True
9
10@registerDecorator
11class OETestID(OETestFilter):
12 attrs = ('oeid',)
13
14 def bind(self, registry, case):
15 super(OETestID, self).bind(registry, case)
16
17 def filtrate(self, filters):
18 if filters.get('oeid'):
19 filterx = intToList(filters['oeid'], 'oeid')
20 del filters['oeid']
21 if _idFilter(self.oeid, filterx):
22 return True
23 return False
diff --git a/meta/lib/oeqa/core/decorator/oetag.py b/meta/lib/oeqa/core/decorator/oetag.py
new file mode 100644
index 0000000000..ad38ab78a5
--- /dev/null
+++ b/meta/lib/oeqa/core/decorator/oetag.py
@@ -0,0 +1,24 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4from . import OETestFilter, registerDecorator
5from oeqa.core.utils.misc import strToList
6
7def _tagFilter(tags, filters):
8 return False if set(tags) & set(filters) else True
9
10@registerDecorator
11class OETestTag(OETestFilter):
12 attrs = ('oetag',)
13
14 def bind(self, registry, case):
15 super(OETestTag, self).bind(registry, case)
16 self.oetag = strToList(self.oetag, 'oetag')
17
18 def filtrate(self, filters):
19 if filters.get('oetag'):
20 filterx = strToList(filters['oetag'], 'oetag')
21 del filters['oetag']
22 if _tagFilter(self.oetag, filterx):
23 return True
24 return False