yocto-check-layer: ensure that all layer dependencies are tested too

In order to be compliant with the YP compatible status, a layer also
needs to ensure that all its dependencies are compatible
too. Currently yocto-check-layer only checks the requested layer,
without testing any dependencies.

With this change, all dependencies are also checked by default, so the
summary printed at the end will give a clear picture whether all
dependencies pass the script or not.

Using --no-auto-dependency can be used to skip that.

(From OE-Core rev: 45d59b774b95c91193a8376b83c05291d555e5c8)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Nicolas Dechesne 2021-07-22 14:46:44 +02:00 committed by Richard Purdie
parent 8dbef94dce
commit 356137bcf2

View File

@ -24,7 +24,7 @@ import scriptpath
scriptpath.add_oe_lib_path()
scriptpath.add_bitbake_lib_path()
from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers
from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers
from oeqa.utils.commands import get_bb_vars
PROGNAME = 'yocto-check-layer'
@ -51,6 +51,8 @@ def main():
help='File to output log (optional)', action='store')
parser.add_argument('--dependency', nargs="+",
help='Layers to process for dependencies', action='store')
parser.add_argument('--no-auto-dependency', help='Disable automatic testing of dependencies',
action='store_true')
parser.add_argument('--machines', nargs="+",
help='List of MACHINEs to be used during testing', action='store')
parser.add_argument('--additional-layers', nargs="+",
@ -121,6 +123,21 @@ def main():
if not layers:
return 1
# Find all dependencies, and get them checked too
if not args.no_auto_dependency:
depends = []
for layer in layers:
layer_depends = get_layer_dependencies(layer, dep_layers, logger)
if layer_depends:
for d in layer_depends:
if d not in depends:
depends.append(d)
for d in depends:
if d not in layers:
logger.info("Adding %s to the list of layers to test, as a dependency", d['name'])
layers.append(d)
shutil.copyfile(bblayersconf, bblayersconf + '.backup')
def cleanup_bblayers(signum, frame):
shutil.copyfile(bblayersconf + '.backup', bblayersconf)