diff options
author | Lee Chee Yang <chee.yang.lee@intel.com> | 2020-07-24 12:16:24 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-07 21:20:21 +0100 |
commit | 75fdc94ecbd16cd59ab4f182ce4b9f5437db52b1 (patch) | |
tree | ee736f68f188f6bd1106d35aa49d59a914ef57cb /scripts/lib | |
parent | a8b8418baed1ff8628d1b9b773b57b4c489ce667 (diff) | |
download | poky-75fdc94ecbd16cd59ab4f182ce4b9f5437db52b1.tar.gz |
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: a10ff925584406e563edfb4042b44c3e8ea57ce3)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit be02e8dbfb0d1decce125322f9f1e11a649756c0)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/checklayer/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index f625d59896..fe545607bb 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py | |||
@@ -229,6 +229,20 @@ def add_layers(bblayersconf, layers, logger): | |||
229 | f.write("\nBBLAYERS += \"%s\"\n" % path) | 229 | f.write("\nBBLAYERS += \"%s\"\n" % path) |
230 | return True | 230 | return True |
231 | 231 | ||
232 | def check_bblayers(bblayersconf, layer_path, logger): | ||
233 | ''' | ||
234 | If layer_path found in BBLAYERS return True | ||
235 | ''' | ||
236 | import bb.parse | ||
237 | import bb.data | ||
238 | |||
239 | ldata = bb.parse.handle(bblayersconf, bb.data.init(), include=True) | ||
240 | for bblayer in (ldata.getVar('BBLAYERS') or '').split(): | ||
241 | if os.path.normpath(bblayer) == os.path.normpath(layer_path): | ||
242 | return True | ||
243 | |||
244 | return False | ||
245 | |||
232 | def check_command(error_msg, cmd, cwd=None): | 246 | def check_command(error_msg, cmd, cwd=None): |
233 | ''' | 247 | ''' |
234 | Run a command under a shell, capture stdout and stderr in a single stream, | 248 | Run a command under a shell, capture stdout and stderr in a single stream, |