diff --git a/scripts/lib/compatlayer/cases/common.py b/scripts/lib/compatlayer/cases/common.py index 2dfcbb1c32..a1cdbab51e 100644 --- a/scripts/lib/compatlayer/cases/common.py +++ b/scripts/lib/compatlayer/cases/common.py @@ -27,8 +27,9 @@ class CommonCompatLayer(OECompatLayerTestCase): 'bitbake -e') def test_signatures(self): - if self.tc.layer['type'] == LayerType.SOFTWARE: - raise unittest.SkipTest("Layer %s isn't BSP or DISTRO one." \ + if self.tc.layer['type'] == LayerType.SOFTWARE and \ + not self.tc.test_software_layer_signatures: + raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \ % self.tc.layer['name']) # task -> (old signature, new signature) diff --git a/scripts/lib/compatlayer/context.py b/scripts/lib/compatlayer/context.py index 4932238798..7811d4ac20 100644 --- a/scripts/lib/compatlayer/context.py +++ b/scripts/lib/compatlayer/context.py @@ -9,6 +9,7 @@ import re from oeqa.core.context import OETestContext class CompatLayerTestContext(OETestContext): - def __init__(self, td=None, logger=None, layer=None): + def __init__(self, td=None, logger=None, layer=None, test_software_layer_signatures=True): super(CompatLayerTestContext, self).__init__(td, logger) self.layer = layer + self.test_software_layer_signatures = test_software_layer_signatures diff --git a/scripts/yocto-compat-layer.py b/scripts/yocto-compat-layer.py index 0d5700b538..ba64b4d6e4 100755 --- a/scripts/yocto-compat-layer.py +++ b/scripts/yocto-compat-layer.py @@ -30,12 +30,12 @@ CASES_PATHS = [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib', 'compatlayer', 'cases')] logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) -def test_layer_compatibility(td, layer): +def test_layer_compatibility(td, layer, test_software_layer_signatures): from compatlayer.context import CompatLayerTestContext logger.info("Starting to analyze: %s" % layer['name']) logger.info("----------------------------------------------------------------------") - tc = CompatLayerTestContext(td=td, logger=logger, layer=layer) + tc = CompatLayerTestContext(td=td, logger=logger, layer=layer, test_software_layer_signatures=test_software_layer_signatures) tc.loadTests(CASES_PATHS) return tc.runTests() @@ -53,6 +53,12 @@ def main(): help='List of MACHINEs to be used during testing', action='store') parser.add_argument('--additional-layers', nargs="+", help='List of additional layers to add during testing', action='store') + group = parser.add_mutually_exclusive_group() + group.add_argument('--with-software-layer-signature-check', action='store_true', dest='test_software_layer_signatures', + default=True, + help='check that software layers do not change signatures (on by default)') + group.add_argument('--without-software-layer-signature-check', action='store_false', dest='test_software_layer_signatures', + help='disable signature checking for software layers') parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery', action='store_true') parser.add_argument('-d', '--debug', help='Enable debug output', @@ -173,7 +179,7 @@ def main(): layers_tested = layers_tested + 1 continue - result = test_layer_compatibility(td, layer) + result = test_layer_compatibility(td, layer, args.test_software_layer_signatures) results[layer['name']] = result results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL' layers_tested = layers_tested + 1