From d5ae7d902a40f26a8c26f4c6d300226689738716 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Thu, 14 Jun 2018 09:52:03 -0700 Subject: Sumo refresh Update external subtrees to latest Yocto sumo. Change-Id: I8364f32bef079841c6e57f1c587f4b1bedf62fef Signed-off-by: Brad Bishop --- poky/meta/lib/oeqa/core/decorator/__init__.py | 10 +++++----- poky/meta/lib/oeqa/core/decorator/data.py | 4 ++-- poky/meta/lib/oeqa/core/loader.py | 17 +++++++++++++---- poky/meta/lib/oeqa/core/target/ssh.py | 2 +- poky/meta/lib/oeqa/runtime/cases/multilib.py | 4 +++- poky/meta/lib/oeqa/runtime/cases/rpm.py | 1 + 6 files changed, 25 insertions(+), 13 deletions(-) (limited to 'poky/meta/lib/oeqa') diff --git a/poky/meta/lib/oeqa/core/decorator/__init__.py b/poky/meta/lib/oeqa/core/decorator/__init__.py index 855b6b9d2..14d7bfcd3 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 ff7bdd98b..31c6dd6be 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 a4744dee0..98fc0f696 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 151b99a77..8ff1f6c67 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 diff --git a/poky/meta/lib/oeqa/runtime/cases/multilib.py b/poky/meta/lib/oeqa/runtime/cases/multilib.py index 8c167f100..89020386b 100644 --- a/poky/meta/lib/oeqa/runtime/cases/multilib.py +++ b/poky/meta/lib/oeqa/runtime/cases/multilib.py @@ -27,6 +27,8 @@ class MultilibTest(OERuntimeTestCase): @skipIfNotInDataVar('MULTILIBS', 'multilib:lib32', "This isn't a multilib:lib32 image") @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['binutils']) + @OEHasPackage(['lib32-libc6']) def test_check_multilib_libc(self): """ Check that a multilib image has both 32-bit and 64-bit libc in. @@ -36,6 +38,6 @@ class MultilibTest(OERuntimeTestCase): @OETestID(279) @OETestDepends(['multilib.MultilibTest.test_check_multilib_libc']) - @OEHasPackage(['lib32-connman']) + @OEHasPackage(['lib32-connman', '!connman']) def test_file_connman(self): self.archtest("/usr/sbin/connmand", "ELF32") diff --git a/poky/meta/lib/oeqa/runtime/cases/rpm.py b/poky/meta/lib/oeqa/runtime/cases/rpm.py index 05b94c7b4..84c59a614 100644 --- a/poky/meta/lib/oeqa/runtime/cases/rpm.py +++ b/poky/meta/lib/oeqa/runtime/cases/rpm.py @@ -16,6 +16,7 @@ class RpmBasicTest(OERuntimeTestCase): cls.skipTest('Tests require image to be build from rpm') @OETestID(960) + @OEHasPackage(['rpm']) @OETestDepends(['ssh.SSHTest.test_ssh']) def test_rpm_help(self): status, output = self.target.run('rpm --help') -- cgit v1.2.3