summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/compatlayer/cases/common.py5
-rw-r--r--scripts/lib/compatlayer/context.py3
-rwxr-xr-xscripts/yocto-compat-layer.py12
3 files changed, 14 insertions, 6 deletions
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):
27 'bitbake -e') 27 'bitbake -e')
28 28
29 def test_signatures(self): 29 def test_signatures(self):
30 if self.tc.layer['type'] == LayerType.SOFTWARE: 30 if self.tc.layer['type'] == LayerType.SOFTWARE and \
31 raise unittest.SkipTest("Layer %s isn't BSP or DISTRO one." \ 31 not self.tc.test_software_layer_signatures:
32 raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \
32 % self.tc.layer['name']) 33 % self.tc.layer['name'])
33 34
34 # task -> (old signature, new signature) 35 # 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
9from oeqa.core.context import OETestContext 9from oeqa.core.context import OETestContext
10 10
11class CompatLayerTestContext(OETestContext): 11class CompatLayerTestContext(OETestContext):
12 def __init__(self, td=None, logger=None, layer=None): 12 def __init__(self, td=None, logger=None, layer=None, test_software_layer_signatures=True):
13 super(CompatLayerTestContext, self).__init__(td, logger) 13 super(CompatLayerTestContext, self).__init__(td, logger)
14 self.layer = layer 14 self.layer = layer
15 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__)),
30 'lib', 'compatlayer', 'cases')] 30 'lib', 'compatlayer', 'cases')]
31logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) 31logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout)
32 32
33def test_layer_compatibility(td, layer): 33def test_layer_compatibility(td, layer, test_software_layer_signatures):
34 from compatlayer.context import CompatLayerTestContext 34 from compatlayer.context import CompatLayerTestContext
35 logger.info("Starting to analyze: %s" % layer['name']) 35 logger.info("Starting to analyze: %s" % layer['name'])
36 logger.info("----------------------------------------------------------------------") 36 logger.info("----------------------------------------------------------------------")
37 37
38 tc = CompatLayerTestContext(td=td, logger=logger, layer=layer) 38 tc = CompatLayerTestContext(td=td, logger=logger, layer=layer, test_software_layer_signatures=test_software_layer_signatures)
39 tc.loadTests(CASES_PATHS) 39 tc.loadTests(CASES_PATHS)
40 return tc.runTests() 40 return tc.runTests()
41 41
@@ -53,6 +53,12 @@ def main():
53 help='List of MACHINEs to be used during testing', action='store') 53 help='List of MACHINEs to be used during testing', action='store')
54 parser.add_argument('--additional-layers', nargs="+", 54 parser.add_argument('--additional-layers', nargs="+",
55 help='List of additional layers to add during testing', action='store') 55 help='List of additional layers to add during testing', action='store')
56 group = parser.add_mutually_exclusive_group()
57 group.add_argument('--with-software-layer-signature-check', action='store_true', dest='test_software_layer_signatures',
58 default=True,
59 help='check that software layers do not change signatures (on by default)')
60 group.add_argument('--without-software-layer-signature-check', action='store_false', dest='test_software_layer_signatures',
61 help='disable signature checking for software layers')
56 parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery', 62 parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery',
57 action='store_true') 63 action='store_true')
58 parser.add_argument('-d', '--debug', help='Enable debug output', 64 parser.add_argument('-d', '--debug', help='Enable debug output',
@@ -173,7 +179,7 @@ def main():
173 layers_tested = layers_tested + 1 179 layers_tested = layers_tested + 1
174 continue 180 continue
175 181
176 result = test_layer_compatibility(td, layer) 182 result = test_layer_compatibility(td, layer, args.test_software_layer_signatures)
177 results[layer['name']] = result 183 results[layer['name']] = result
178 results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL' 184 results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL'
179 layers_tested = layers_tested + 1 185 layers_tested = layers_tested + 1