summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa/core
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/lib/oeqa/core')
-rw-r--r--poky/meta/lib/oeqa/core/decorator/__init__.py10
-rw-r--r--poky/meta/lib/oeqa/core/decorator/data.py4
-rw-r--r--poky/meta/lib/oeqa/core/loader.py17
-rw-r--r--poky/meta/lib/oeqa/core/target/ssh.py2
4 files changed, 21 insertions, 12 deletions
diff --git a/poky/meta/lib/oeqa/core/decorator/__init__.py b/poky/meta/lib/oeqa/core/decorator/__init__.py
index 855b6b9d28..14d7bfcd35 100644
--- a/poky/meta/lib/oeqa/core/decorator/__init__.py
+++ b/poky/meta/lib/oeqa/core/decorator/__init__.py
@@ -2,15 +2,15 @@
# Released under the MIT license (see COPYING.MIT)
from functools import wraps
-from abc import abstractmethod
+from abc import abstractmethod, ABCMeta
decoratorClasses = set()
-def registerDecorator(obj):
- decoratorClasses.add(obj)
- return obj
+def registerDecorator(cls):
+ decoratorClasses.add(cls)
+ return cls
-class OETestDecorator(object):
+class OETestDecorator(object, metaclass=ABCMeta):
case = None # Reference of OETestCase decorated
attrs = None # Attributes to be loaded by decorator implementation
diff --git a/poky/meta/lib/oeqa/core/decorator/data.py b/poky/meta/lib/oeqa/core/decorator/data.py
index ff7bdd98b7..31c6dd6be7 100644
--- a/poky/meta/lib/oeqa/core/decorator/data.py
+++ b/poky/meta/lib/oeqa/core/decorator/data.py
@@ -61,10 +61,10 @@ class skipIfNotInDataVar(OETestDecorator):
attrs = ('var', 'value', 'msg')
def setUpDecorator(self):
- msg = ('Checking if %r value is in %r to run '
+ msg = ('Checking if %r value contains %r to run '
'the test' % (self.var, self.value))
self.logger.debug(msg)
- if not self.value in self.case.td.get(self.var):
+ if not self.value in (self.case.td.get(self.var) or ""):
self.case.skipTest(self.msg)
@registerDecorator
diff --git a/poky/meta/lib/oeqa/core/loader.py b/poky/meta/lib/oeqa/core/loader.py
index a4744dee03..98fc0f696a 100644
--- a/poky/meta/lib/oeqa/core/loader.py
+++ b/poky/meta/lib/oeqa/core/loader.py
@@ -155,7 +155,16 @@ class OETestLoader(unittest.TestLoader):
class_name = case.__class__.__name__
test_name = case._testMethodName
- if self.modules:
+ # 'auto' is a reserved key word to run test cases automatically
+ # warn users if their test case belong to a module named 'auto'
+ if module_name_small == "auto":
+ bb.warn("'auto' is a reserved key word for TEST_SUITES. "
+ "But test case '%s' is detected to belong to auto module. "
+ "Please condier using a new name for your module." % str(case))
+
+ # check if case belongs to any specified module
+ # if 'auto' is specified, such check is skipped
+ if self.modules and not 'auto' in self.modules:
module = None
try:
module = self.modules[module_name_small]
@@ -245,7 +254,7 @@ class OETestLoader(unittest.TestLoader):
for tcName in testCaseNames:
case = self._getTestCase(testCaseClass, tcName)
# Filer by case id
- if not (self.tests and not 'all' in self.tests
+ if not (self.tests and not 'auto' in self.tests
and not getCaseID(case) in self.tests):
self._handleTestCaseDecorators(case)
@@ -309,14 +318,14 @@ class OETestLoader(unittest.TestLoader):
module_name = module.__name__
# Normal test modules are loaded if no modules were specified,
- # if module is in the specified module list or if 'all' is in
+ # if module is in the specified module list or if 'auto' is in
# module list.
# Underscore modules are loaded only if specified in module list.
load_module = True if not module_name.startswith('_') \
and (not self.modules \
or module_name in self.modules \
or module_name_small in self.modules \
- or 'all' in self.modules) \
+ or 'auto' in self.modules) \
else False
load_underscore = True if module_name.startswith('_') \
diff --git a/poky/meta/lib/oeqa/core/target/ssh.py b/poky/meta/lib/oeqa/core/target/ssh.py
index 151b99a77f..8ff1f6c677 100644
--- a/poky/meta/lib/oeqa/core/target/ssh.py
+++ b/poky/meta/lib/oeqa/core/target/ssh.py
@@ -208,7 +208,7 @@ def SSHCall(command, logger, timeout=None, **opts):
try:
if select.select([process.stdout], [], [], 5)[0] != []:
reader = codecs.getreader('utf-8')(process.stdout)
- data = reader.read(1024, 1024)
+ data = reader.read(1024, 4096)
if not data:
process.stdout.close()
eof = True