summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-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