Message ID | 20251023072513.280477-3-yoann.congal@smile.fr |
---|---|
State | New |
Headers | show |
Series | [1/3] meta/files: Add a jsonschema for bitbake-setup configuration files | expand |
On Thu, 23 Oct 2025 at 09:25, Yoann Congal via lists.openembedded.org <yoann.congal=smile.fr@lists.openembedded.org> wrote: > RFC: This structure takes ~7s per schema validation. I guess because of > the multiple bb_get_var in each loop. I'll glady take suggestions on how > to improve this. I guess you need to refactor the code to obtain them only once on the top level (or even in the test initialization where python3-jsonschema-native is built), and set as object properties: self.something. Otherwise lgtm, now that we have a schema and tests, we can start messing around with it :) Alex
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 43a158fcf2..8397506f04 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -155,6 +155,20 @@ class BitbakeLayers(OESelftestTestCase): jsonschema = "layers.schema.json" self.validate_json(json, jsonschema) + def test_validate_bitbake_setup_default_registry(self): + jsonschema = "bitbake-setup.schema.json" + + bitbake_path = get_bb_var("BITBAKEPATH") + default_registry_path = os.path.join(bitbake_path, "..", "default-registry", "configurations") + + for root, _, files in os.walk(default_registry_path): + for f in files: + if not f.endswith(".conf.json"): + continue + json = os.path.join(root, f) + self.logger.debug("Validating %s", json) + self.validate_json(json, jsonschema) + def test_bitbakelayers_setup(self): result = runCmd('bitbake-layers create-layers-setup {}'.format(self.testlayer_path)) jsonfile = os.path.join(self.testlayer_path, "setup-layers.json")