diff options
| author | Yoann Congal <yoann.congal@smile.fr> | 2025-10-24 02:16:20 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-27 17:20:42 +0000 |
| commit | 440fba30b72bbb87580b804c1301637e5bc55247 (patch) | |
| tree | ffc618fca8a1ab127faa4b87b8cd2c6f0961c01f /meta | |
| parent | 41438346ce051fc12369ee5e2501bf8c2cb6b4a4 (diff) | |
| download | poky-440fba30b72bbb87580b804c1301637e5bc55247.tar.gz | |
selftest/bblayers: Add a test to validate bitbake-setup registry schema
This test validates bitbake/default-registry/configurations/*.conf.json
against bitbake-setup.schema.json:
INFO - test_validate_bitbake_setup_default_registry (bblayers.BitbakeLayers.test_validate_bitbake_setup_default_registry)
DEBUG - Validating .../poky/bitbake/bin/../default-registry/configurations/oe-nodistro.conf.json
DEBUG - Validating .../poky/bitbake/bin/../default-registry/configurations/poky-master.conf.json
INFO - ... ok
INFO - test_validate_examplelayersjson (bblayers.BitbakeLayers.test_validate_examplelayersjson)
INFO - ... ok
INFO - ----------------------------------------------------------------------
INFO - Ran 2 tests in 110.469s
INFO - OK
INFO - RESULTS:
INFO - RESULTS - bblayers.BitbakeLayers.test_validate_bitbake_setup_default_registry: PASSED (0.92s)
INFO - RESULTS - bblayers.BitbakeLayers.test_validate_examplelayersjson: PASSED (0.19s)
INFO - SUMMARY:
INFO - oe-selftest () - Ran 2 tests in 110.469s
INFO - oe-selftest - OK - All required tests passed (successes=2, skipped=0, failures=0, errors=0)
(From OE-Core rev: 86978295c228640e2c33076d1f51db9f2fe7063b)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/bblayers.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 5b13c9dffe..6c710b2751 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
| @@ -21,8 +21,9 @@ class BitbakeLayers(OESelftestTestCase): | |||
| 21 | bitbake("-c addto_recipe_sysroot python3-jsonschema-native") | 21 | bitbake("-c addto_recipe_sysroot python3-jsonschema-native") |
| 22 | 22 | ||
| 23 | # Fetch variables used in multiple test cases | 23 | # Fetch variables used in multiple test cases |
| 24 | bb_vars = get_bb_vars(['COREBASE']) | 24 | bb_vars = get_bb_vars(['COREBASE', 'BITBAKEPATH']) |
| 25 | cls.corebase = bb_vars['COREBASE'] | 25 | cls.corebase = bb_vars['COREBASE'] |
| 26 | cls.bitbakepath = bb_vars['BITBAKEPATH'] | ||
| 26 | cls.jsonschema_staging_bindir = get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native') | 27 | cls.jsonschema_staging_bindir = get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native') |
| 27 | 28 | ||
| 28 | def test_bitbakelayers_layerindexshowdepends(self): | 29 | def test_bitbakelayers_layerindexshowdepends(self): |
| @@ -161,6 +162,19 @@ class BitbakeLayers(OESelftestTestCase): | |||
| 161 | json = os.path.join(self.corebase, "meta/files/layers.example.json") | 162 | json = os.path.join(self.corebase, "meta/files/layers.example.json") |
| 162 | self.validate_layersjson(json) | 163 | self.validate_layersjson(json) |
| 163 | 164 | ||
| 165 | def test_validate_bitbake_setup_default_registry(self): | ||
| 166 | jsonschema = "bitbake-setup.schema.json" | ||
| 167 | |||
| 168 | default_registry_path = os.path.join(self.bitbakepath, "..", "default-registry", "configurations") | ||
| 169 | |||
| 170 | for root, _, files in os.walk(default_registry_path): | ||
| 171 | for f in files: | ||
| 172 | if not f.endswith(".conf.json"): | ||
| 173 | continue | ||
| 174 | json = os.path.join(root, f) | ||
| 175 | self.logger.debug("Validating %s", json) | ||
| 176 | self.validate_json(json, jsonschema) | ||
| 177 | |||
| 164 | def test_bitbakelayers_setup(self): | 178 | def test_bitbakelayers_setup(self): |
| 165 | result = runCmd('bitbake-layers create-layers-setup {}'.format(self.testlayer_path)) | 179 | result = runCmd('bitbake-layers create-layers-setup {}'.format(self.testlayer_path)) |
| 166 | jsonfile = os.path.join(self.testlayer_path, "setup-layers.json") | 180 | jsonfile = os.path.join(self.testlayer_path, "setup-layers.json") |
