bitbake-bblayers/create: Fix layer name generation
PATCH 1/2 bitbake-bblayers/create: Fix layer name generation
The path to where the layer was being created was taken verbatim as the name of the layer when generating the layer.conf and README files from templates. This causes problems in the layer.conf file because it would result in strangely named variables like
BBFILE_PATTERN_../my-layer = "..."
Instead of blindly taking the path, use the name of the last component of the path as the layer name.
Additionally, rework the template files to use python format strings with named parameters so that the same argument doesn't have to be repeated multiple times.
[YOCTO #12808]
--- meta/lib/bblayers/create.py | 7 +++++-- meta/lib/bblayers/templates/README | 12 ++++++------ meta/lib/bblayers/templates/layer.conf | 16 ++++++++-------- 3 files changed, 19 insertions(+), 16 deletions(-)
meta/lib/bblayers/create.py +5 -2
@@ -30,8 +30,10 @@ class CreatePlugin(LayerPlugin): conf = os.path.join(layerdir, 'conf') bb.utils.mkdirhier(conf) + layername = os.path.basename(os.path.normpath(args.layerdir)) + # Create the README from templates/README - readme_template = read_template('README') % (args.layerdir, args.layerdir, args.layerdir, args.layerdir, args.layerdir, args.layerdir) + readme_template = read_template('README').format(layername=layername) readme = os.path.join(layerdir, 'README') with open(readme, 'w') as fd: fd.write(readme_template)
@@ -47,7 +49,8 @@ class CreatePlugin(LayerPlugin): compat = self.tinfoil.config_data.getVar('LAYERSERIES_COMPAT_core') or "" # Create the layer.conf from templates/layer.conf - layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority, args.layerdir, args.layerdir, compat) + layerconf_template = read_template('layer.conf').format( + layername=layername, priority=args.priority, compat=compat) layerconf = os.path.join(conf, 'layer.conf') with open(layerconf, 'w') as fd: fd.write(layerconf_template)
meta/lib/bblayers/templates/README +6 -6
@@ -1,4 +1,4 @@ -This README file contains information on the contents of the %s layer. +This README file contains information on the contents of the {layername} layer. Please see the corresponding sections below for details.
@@ -18,7 +18,7 @@ Dependencies Patches ======= -Please submit any patches against the %s layer to the xxxx mailing list ([email protected]) +Please submit any patches against the {layername} layer to the xxxx mailing list ([email protected]) and cc: the maintainer: Maintainer: XXX YYYYYY <[email protected]>
@@ -26,16 +26,16 @@ Maintainer: XXX YYYYYY <[email protected]> Table of Contents ================= - I. Adding the %s layer to your build + I. Adding the {layername} layer to your build II. Misc -I. Adding the %s layer to your build +I. Adding the {layername} layer to your build ================================================= -Run 'bitbake-layers add-layer %s' +Run 'bitbake-layers add-layer {layername}' II. Misc ======== ---- replace with specific information about the %s layer --- +--- replace with specific information about the {layername} layer ---
meta/lib/bblayers/templates/layer.conf +8 -8
@@ -1,13 +1,13 @@ # We have a conf and classes directory, add to BBPATH -BBPATH .= ":${LAYERDIR}" +BBPATH .= ":${{LAYERDIR}}" # We have recipes-* directories, add to BBFILES -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ - ${LAYERDIR}/recipes-*/*/*.bbappend" +BBFILES += "${{LAYERDIR}}/recipes-*/*/*.bb \ + ${{LAYERDIR}}/recipes-*/*/*.bbappend" -BBFILE_COLLECTIONS += "%s" -BBFILE_PATTERN_%s = "^${LAYERDIR}/" -BBFILE_PRIORITY_%s = "%s" +BBFILE_COLLECTIONS += "{layername}" +BBFILE_PATTERN_{layername} = "^${{LAYERDIR}}/" +BBFILE_PRIORITY_{layername} = "{priority}" -LAYERDEPENDS_%s = "core" -LAYERSERIES_COMPAT_%s = "%s" +LAYERDEPENDS_{layername} = "core" +LAYERSERIES_COMPAT_{layername} = "{compat}"
Signature · 1 line
2.17.1
PATCH 2/2 oe-selftest: Add bitbake-layer create-layer test
Adds a test that creates a layer, adds it to bblayers.conf, then ensure that it appears properly in bitbake-layers show-layers.
--- meta/lib/oeqa/selftest/cases/bblayers.py | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/bblayers.py +25 -1
@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID
@@ -85,6 +85,30 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self): + priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + self.assertTrue(find_in_contents, "%s not found in layers" % layername) + + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] + bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) + + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertTrue(bb_vars[varname], "%s not found" % varname) + + find_in_contents = re.search(r'(^|\s)' + re.escape(layername) + r'($|\s)', bb_vars['BBFILE_COLLECTIONS']) + self.assertTrue(find_in_contents, "%s not in BBFILE_COLLECTIONS" % layername) + + self.assertEqual(str(priority), bb_vars['BBFILE_PRIORITY_%s' % layername]) + def get_recipe_basename(self, recipe): recipe_file = "" result = runCmd("bitbake-layers show-recipes -f %s" % recipe)
Signature · 1 line
2.17.1
Re: [PATCH 2/2] oe-selftest: Add bitbake-layer create-layer test
Quoted 26 lines · Joshua Watt
Adds a test that creates a layer, adds it to bblayers.conf, then ensure that it appears properly in bitbake-layers show-layers.
Signed-off-by Joshua Watt <[email protected]>--- meta/lib/oeqa/selftest/cases/bblayers.py | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)meta/lib/oeqa/selftest/cases/bblayers.py +2
-1@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID@@ -85,6 +85,30 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self):
meta/lib/oeqa/selftest/cases/bblayers.py class BitbakeLayers(OESelftestTestCase): · line 98
Quoted 10 lines
meta/lib/oeqa/selftest/cases/bblayers.py +10
-0+ priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + self.assertTrue(find_in_contents, "%s not found in layers" % layername)
This looks good and top marks for adding unit tests!
One tip learnt from experience is that assertTrue can be problematic because when it fails, the debug output it gives is useless as it says it wasn't True. In this case, you need to put result.output into the msg so that we'd have some chance of debugging it from the failure message.
meta/lib/oeqa/selftest/cases/bblayers.py class BitbakeLayers(OESelftestTestCase): · line 105
Quoted 7 lines
meta/lib/oeqa/selftest/cases/bblayers.py +7
-0+ + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] + bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) + + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertTrue(bb_vars[varname], "%s not found" % varname)
self.assertIsNotNone() ?
Cheers,
Richard
PATCH v2 1/1 oe-selftest: Add bitbake-layer create-layer test
In reply to Joshua WattAdds a test that creates a layer, adds it to bblayers.conf, then ensure that it appears properly in bitbake-layers show-layers.
--- meta/lib/oeqa/selftest/cases/bblayers.py | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/bblayers.py +25 -1
@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID
@@ -85,6 +85,30 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self): + priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + self.assertTrue(find_in_contents, "%s not found in layers\n%s" % (layername, result.output)) + + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] + bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) + + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertIsNotNone(bb_vars[varname], "%s not found" % varname) + + find_in_contents = re.search(r'(^|\s)' + re.escape(layername) + r'($|\s)', bb_vars['BBFILE_COLLECTIONS']) + self.assertTrue(find_in_contents, "%s not in BBFILE_COLLECTIONS" % layername) + + self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) + def get_recipe_basename(self, recipe): recipe_file = "" result = runCmd("bitbake-layers show-recipes -f %s" % recipe)
Signature · 1 line
2.17.1
Re: [PATCH v2] oe-selftest: Add bitbake-layer create-layer test
Quoted 9 lines · Joshua Watt
Adds a test that creates a layer, adds it to bblayers.conf, then ensure
that it appears properly in bitbake-layers show-layers.Signed-off-by Joshua Watt <[email protected]>--- meta/lib/oeqa/selftest/cases/bblayers.py | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
I ran this on the autobuilder and it showed:
Tests were working, it runs this test, then everything fails:
2018-06-29 23:50:23,781 - oe-selftest - INFO - ... OK (719.550s) 2018-06-29 23:50:23,783 - oe-selftest - INFO - test_bitbakelayers_add_remove (bblayers.BitbakeLayers) 2018-06-29 23:50:39,742 - oe-selftest - INFO - ... OK (15.959s) 2018-06-29 23:50:39,742 - oe-selftest - INFO - test_bitbakelayers_createlayer (bblayers.BitbakeLayers) 2018-06-29 23:50:49,526 - oe-selftest - INFO - ... OK (9.783s) 2018-06-29 23:50:49,526 - oe-selftest - INFO - test_bitbakelayers_flatten (bblayers.BitbakeLayers) 2018-06-29 23:50:49,971 - oe-selftest - INFO - ... FAIL (0.445s) 2018-06-29 23:50:49,971 - oe-selftest - INFO - test_bitbakelayers_showappends (bblayers.BitbakeLayers) 2018-06-29 23:50:50,356 - oe-selftest - INFO - ... FAIL (0.385s) 2018-06-29 23:50:50,356 - oe-selftest - INFO - test_bitbakelayers_showcrossdepends (bblayers.BitbakeLayers) 2018-06-29 23:50:50,761 - oe-selftest - INFO - ... FAIL (0.405s)
Later you can see the error:
ERROR: Layer directory '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/test-bitbakelayer-layercreate' does not exist! Please check BBLAYERS in /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/conf/bblayers.conf
so I think something in the cleanup of the test is wrong...
Cheers,
Richard
Quoted 58 lines
meta/lib/oeqa/selftest/cases/bblayers.py +11
-1@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID@@ -85,6 +85,30 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show- recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self): + priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' +
re.escape(layerpath)+ r'\s+' + re.escape(str(priority)), result.output)
+ self.assertTrue(find_in_contents, "%s not found in
layers\n%s" % (layername, result.output))meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN','LAYERDEPENDS', '
LAYERSERIES_COMPAT']
+bb_vars= get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' %
(v, layername) for v in layervars])meta/lib/oeqa/selftest/cases/bblayers.py +4
-0+ + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertIsNotNone(bb_vars[varname], "%s not found" %varname)
meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + find_in_contents = re.search(r'(^|\s)' +
re.escape(layername)+ r'($|\s)', bb_vars['BBFILE_COLLECTIONS'])
+ self.assertTrue(find_in_contents, "%s not inBBFILE_COLLECTIONS" % layername)meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername],str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) +
defget_recipe_basename(self, recipe):
recipe_file= ""
result = runCmd("bitbake-layers show-recipes -f %s" %
recipe)
Re: [PATCH v2] oe-selftest: Add bitbake-layer create-layer test
Quoted 30 lines · Richard Purdie
Quoted 9 lines · Joshua Watt
Adds a test that creates a layer, adds it to bblayers.conf, then ensure
that it appears properly in bitbake-layers show-layers.Signed-off-by Joshua Watt <[email protected]>--- meta/lib/oeqa/selftest/cases/bblayers.py | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)I ran this on the autobuilder and it showed:
Tests were working, it runs this test, then everything fails:
2018-06-29 23:50:23,781 - oe-selftest - INFO - ... OK (719.550s) 2018-06-29 23:50:23,783 - oe-selftest - INFO - test_bitbakelayers_add_remove (bblayers.BitbakeLayers) 2018-06-29 23:50:39,742 - oe-selftest - INFO - ... OK (15.959s) 2018-06-29 23:50:39,742 - oe-selftest - INFO - test_bitbakelayers_createlayer (bblayers.BitbakeLayers) 2018-06-29 23:50:49,526 - oe-selftest - INFO - ... OK (9.783s) 2018-06-29 23:50:49,526 - oe-selftest - INFO - test_bitbakelayers_flatten (bblayers.BitbakeLayers) 2018-06-29 23:50:49,971 - oe-selftest - INFO - ... FAIL (0.445s) 2018-06-29 23:50:49,971 - oe-selftest - INFO - test_bitbakelayers_showappends (bblayers.BitbakeLayers) 2018-06-29 23:50:50,356 - oe-selftest - INFO - ... FAIL (0.385s) 2018-06-29 23:50:50,356 - oe-selftest - INFO - test_bitbakelayers_showcrossdepends (bblayers.BitbakeLayers) 2018-06-29 23:50:50,761 - oe-selftest - INFO - ... FAIL (0.405s)
Quoted 5 lines
Later you can see the error:
ERROR: Layer directory '
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/test-bitbakelayer-layercreate' does not exist! Please check BBLAYERS in/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/conf/bblayers.confso I think something in the cleanup of the test is wrong...
Oops, sorry about that. I think I saw that my bblayer.conf file was correctly restored after oe-selftest completed, and assumed that was being done between each test case. It should be fixed now in V3.
I wonder if you could make oe-selftest issue a warning when it exists if the original bblayer.conf doesn't match the current one....
Quoted 63 lines
Cheers,
Richard
Quoted 58 lines
meta/lib/oeqa/selftest/cases/bblayers.py +11
-1@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID@@ -85,6 +85,30 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show- recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self): + priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' +
re.escape(layerpath)+ r'\s+' + re.escape(str(priority)), result.output)
+ self.assertTrue(find_in_contents, "%s not found in
layers\n%s" % (layername, result.output))meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN','LAYERDEPENDS', '
LAYERSERIES_COMPAT']
+bb_vars= get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' %
(v, layername) for v in layervars])meta/lib/oeqa/selftest/cases/bblayers.py +4
-0+ + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertIsNotNone(bb_vars[varname], "%s not found" %varname)
meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + find_in_contents = re.search(r'(^|\s)' +
re.escape(layername)+ r'($|\s)', bb_vars['BBFILE_COLLECTIONS'])
+ self.assertTrue(find_in_contents, "%s not inBBFILE_COLLECTIONS" % layername)meta/lib/oeqa/selftest/cases/bblayers.py +2
-0+ + self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername],str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) +
defget_recipe_basename(self, recipe):
recipe_file= ""
result = runCmd("bitbake-layers show-recipes -f %s" %
recipe)
PATCH v3 1/1 oe-selftest: Add bitbake-layer create-layer test
In reply to Joshua WattAdds a test that creates a layer, adds it to bblayers.conf, then ensure that it appears properly in bitbake-layers show-layers.
--- meta/lib/oeqa/selftest/cases/bblayers.py | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/bblayers.py +26 -1
@@ -2,7 +2,7 @@ import os import re import oeqa.utils.ftools as ftools -from oeqa.utils.commands import runCmd, get_bb_var +from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars from oeqa.selftest.case import OESelftestTestCase from oeqa.core.decorator.oeid import OETestID
@@ -85,6 +85,31 @@ class BitbakeLayers(OESelftestTestCase): self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') self.assertIn('ERROR:', result.output) + def test_bitbakelayers_createlayer(self): + priority = 10 + layername = 'test-bitbakelayer-layercreate' + layerpath = os.path.join(get_bb_var('COREBASE'), layername) + self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) + result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + self.track_for_cleanup(layerpath) + result = runCmd('bitbake-layers add-layer %s' % layerpath) + self.add_command_to_tearDown('bitbake-layers remove-layer %s' % layerpath) + result = runCmd('bitbake-layers show-layers') + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + self.assertTrue(find_in_contents, "%s not found in layers\n%s" % (layername, result.output)) + + layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] + bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) + + for v in layervars: + varname = '%s_%s' % (v, layername) + self.assertIsNotNone(bb_vars[varname], "%s not found" % varname) + + find_in_contents = re.search(r'(^|\s)' + re.escape(layername) + r'($|\s)', bb_vars['BBFILE_COLLECTIONS']) + self.assertTrue(find_in_contents, "%s not in BBFILE_COLLECTIONS" % layername) + + self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) + def get_recipe_basename(self, recipe): recipe_file = "" result = runCmd("bitbake-layers show-recipes -f %s" % recipe)
Signature · 1 line
2.17.0