mirror of
https://git.yoctoproject.org/poky
synced 2026-09-15 06:49:33 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
95a2ec6aab
commit
b8cebdb96c
23
meta/lib/oeqa/core/decorator/oeid.py
Normal file
23
meta/lib/oeqa/core/decorator/oeid.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Copyright (C) 2016 Intel Corporation
|
||||||
|
# Released under the MIT license (see COPYING.MIT)
|
||||||
|
|
||||||
|
from . import OETestFilter, registerDecorator
|
||||||
|
from oeqa.core.utils.misc import intToList
|
||||||
|
|
||||||
|
def _idFilter(oeid, filters):
|
||||||
|
return False if oeid in filters else True
|
||||||
|
|
||||||
|
@registerDecorator
|
||||||
|
class OETestID(OETestFilter):
|
||||||
|
attrs = ('oeid',)
|
||||||
|
|
||||||
|
def bind(self, registry, case):
|
||||||
|
super(OETestID, self).bind(registry, case)
|
||||||
|
|
||||||
|
def filtrate(self, filters):
|
||||||
|
if filters.get('oeid'):
|
||||||
|
filterx = intToList(filters['oeid'], 'oeid')
|
||||||
|
del filters['oeid']
|
||||||
|
if _idFilter(self.oeid, filterx):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
24
meta/lib/oeqa/core/decorator/oetag.py
Normal file
24
meta/lib/oeqa/core/decorator/oetag.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Copyright (C) 2016 Intel Corporation
|
||||||
|
# Released under the MIT license (see COPYING.MIT)
|
||||||
|
|
||||||
|
from . import OETestFilter, registerDecorator
|
||||||
|
from oeqa.core.utils.misc import strToList
|
||||||
|
|
||||||
|
def _tagFilter(tags, filters):
|
||||||
|
return False if set(tags) & set(filters) else True
|
||||||
|
|
||||||
|
@registerDecorator
|
||||||
|
class OETestTag(OETestFilter):
|
||||||
|
attrs = ('oetag',)
|
||||||
|
|
||||||
|
def bind(self, registry, case):
|
||||||
|
super(OETestTag, self).bind(registry, case)
|
||||||
|
self.oetag = strToList(self.oetag, 'oetag')
|
||||||
|
|
||||||
|
def filtrate(self, filters):
|
||||||
|
if filters.get('oetag'):
|
||||||
|
filterx = strToList(filters['oetag'], 'oetag')
|
||||||
|
del filters['oetag']
|
||||||
|
if _tagFilter(self.oetag, filterx):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
Reference in New Issue
Block a user