path: root/scripts
diff options
authorLee Chee Yang <>2020-07-24 12:16:24 +0800
committerRichard Purdie <>2020-07-27 10:37:58 +0100
commit4cbea1019781e9595655448347a38dae1db5ee29 (patch)
tree2f6be6ff02d55142cb1488d6bf9d247e1455b398 /scripts
parent9a0ec350ace36c3b2447fff62726e65d25bcb7db (diff)
checklayer: check layer in BBLAYERS before test
layer under test should absent from BBLAYERS when running yocto-check-layer. This allow to get signatures before layer under test. There are existing steps to add the layer under test to BBLAYERS after getting initial signatures. add steps to check for layer under test in BBLAYERS before running any test, skip test for the layer if the layer under test exist in BBLAYERS. [YOCTO #13176] (From OE-Core rev: be02e8dbfb0d1decce125322f9f1e11a649756c0) Signed-off-by: Lee Chee Yang <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
2 files changed, 22 insertions, 1 deletions
diff --git a/scripts/lib/checklayer/ b/scripts/lib/checklayer/
index f625d59896..fe545607bb 100644
--- a/scripts/lib/checklayer/
+++ b/scripts/lib/checklayer/
@@ -229,6 +229,20 @@ def add_layers(bblayersconf, layers, logger):
f.write("\nBBLAYERS += \"%s\"\n" % path)
return True
+def check_bblayers(bblayersconf, layer_path, logger):
+ '''
+ If layer_path found in BBLAYERS return True
+ '''
+ import bb.parse
+ import
+ ldata = bb.parse.handle(bblayersconf,, include=True)
+ for bblayer in (ldata.getVar('BBLAYERS') or '').split():
+ if os.path.normpath(bblayer) == os.path.normpath(layer_path):
+ return True
+ return False
def check_command(error_msg, cmd, cwd=None):
Run a command under a shell, capture stdout and stderr in a single stream,
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer
index ca6c79bc8d..b7c83c8b54 100755
--- a/scripts/yocto-check-layer
+++ b/scripts/yocto-check-layer
@@ -24,7 +24,7 @@ import scriptpath
-from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures
+from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers
from oeqa.utils.commands import get_bb_vars
PROGNAME = 'yocto-check-layer'
@@ -138,6 +138,13 @@ def main():
layer['type'] == LayerType.ERROR_BSP_DISTRO:
+ if check_bblayers(bblayersconf, layer['path'], logger):
+"%s already in %s. To capture initial signatures, layer under test should not present "
+ "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name']))
+ results[layer['name']] = None
+ results_status[layer['name']] = 'SKIPPED (Layer under test should not present in BBLAYERS)'
+ continue
+'')"Setting up for %s(%s), %s" % (layer['name'], layer['type'],