From patchwork Thu Oct 23 07:25:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80D53CCF9E0 for ; Thu, 23 Oct 2025 07:25:40 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.groups.io with SMTP id smtpd.web10.14639.1761204339409287605 for ; Thu, 23 Oct 2025 00:25:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=hdtdOeI5; spf=pass (domain: smile.fr, ip: 209.85.221.41, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-4298a028de6so242104f8f.0 for ; Thu, 23 Oct 2025 00:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1761204337; x=1761809137; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6MKVBn/G0HMc9RVgqPm5CwXup2W53u5Pwl5IlCIrT1I=; b=hdtdOeI5qXY6yc9/k75idVNU9g1PU7O7sa8FxiZvtIel937ZcsP4qKiWxI/3h3ZJsV JSpvPa2IsXGJsYFgMLJ87hGtaPxo4Vi0xZRYLQ4r+4bjvJaNc1n3CgC38fcj9HAZfC+8 d7W1eYHMy7tRA5Fmr08AK9mehWGZMR4MsgWhw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761204337; x=1761809137; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6MKVBn/G0HMc9RVgqPm5CwXup2W53u5Pwl5IlCIrT1I=; b=nbGj2xSru826T8nN8PPiUt2Aa8zsiazt5zaDHaZ821H9L0jEsryPHd41/pRGKwZH+S ZkTJDn1sxgrhjwhJTobw3obrLeGc5PpnfDB6KXzFEFzAmkPQiBDL/kpfBC7x2dSjFuCU VthxWBVoBx40AW5ouSxykWdnYemsCw6SoMEI/Cr/v8M0Xa9PgXfGOrzVk32smqm0SE/Y ovVLtu4v6zMBp/o2QxclxNRhecSEOd4GkkVm47kvt1gH6Q8F3yHW1kSCB/1uWQ5Eu5Kp EiBBtBqWKM3bfGE9t0QyhV/Bagq5UPZnLqoDosuhbkyKh0AGeOe1TIb/djJDmsfg2yJ7 TwLA== X-Gm-Message-State: AOJu0YzR8ikBd2FkbEXXi64eVzqOqm3jeuM3UfjlmpBSxh8ZjIjM0AsH 93hqAIqwdEsXpKtLdl+yZz5yjq435BPZgokIT1Hz+7wyQSSTDof4k4nl8VcifOPm5dcKoUE/Gan 57HF56TI= X-Gm-Gg: ASbGnctePXPjs6ibpPsyM7uISUX8XntOQAYBNwUECs3F6CZz2P6CGhlMfa1AC+VQ6ag 2pGYkVYxQgtRw9w+K1dqkJjcLcJAZmWqgp0VdM5xrER5YkQq52vFigKlODS4o8QwEjrDwOv9/2C uRS/9X/5C00StARw1FwzVf+MMcPTgbltjPgx5Tx2pVwYXwj9KzMwJUrRfV/1cqGL9oijMJj5qDd 14vLOvb1dPU3KUWGZplYjkldE2LT9ofR5J+eRhwjHwTlamaBGy34BaQuzfjkpCDpukG4xxOZj4M 1HMXQKdftoGMzcVjSvouoezHah66Tj/GK9w4y2h7g8AUGsAK+d4V7guLvIBEKmOPvv99DASMNk2 yH6q0lTicM7Rkx8+JRSW0w2ItsIJ+8moCyYd7xxSCcTv6hfCnvuxm+CFMRLH4oyfeOnNgUcolKZ wDETu/rh/Kx44yNi7boM663vvfnivopsd8aF6auwDAivwFjGIAVn7jgzr0R4ZQdlzuo0kNGMvJY zUUQ8MC80RlWc8K X-Google-Smtp-Source: AGHT+IFdAKymsiVBLyaLPPl6PnIBobwTdrbJ6b6cqHqmTQeqNMTvZzBjgS0jAE6qux4H1ZbWlTVRSg== X-Received: by 2002:a05:6000:2013:b0:425:57dd:58ca with SMTP id ffacd0b85a97d-42853255425mr3812856f8f.8.1761204337451; Thu, 23 Oct 2025 00:25:37 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429898adf78sm2608818f8f.32.2025.10.23.00.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Oct 2025 00:25:37 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH 1/3] meta/files: Add a jsonschema for bitbake-setup configuration files Date: Thu, 23 Oct 2025 09:25:11 +0200 Message-Id: <20251023072513.280477-1-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Oct 2025 07:25:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225220 From: Yoann Congal This schema is a bit loose and should validate any configuration files working with bitbake-setup but, also, some broken ones: * If present, a "bb-layer" can be an empty array. * bb-setup need at least one of "bb-layers" or "oe-template", that is not enforced in the current schema. * bb-setup accepts "configurations = []" but it results in a impossible choice in interactive mode. This is rejected by the schema. * In each configuration, "name" and "description" are optional but the flatten configuration must have them. This is not enforced by the schema. To test a configuration files against this schema: (for exemple to validate bitbake default registry) $ pip install check-jsonschema $ check-jsonschema -v --schemafile meta/files/bitbake-setup.schema.json bitbake/default-registry/configurations/* ok -- validation done The following files were checked: bitbake/default-registry/configurations/oe-nodistro.conf.json bitbake/default-registry/configurations/poky-master.conf.json Signed-off-by: Yoann Congal --- Notes: * I plan to send a patch to make bb-setup reject "configurations = []" * '"additionalProperties": false' makes "comments":"..." impossible right now, I plan to add them later. --- meta/files/bitbake-setup.schema.json | 108 +++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 meta/files/bitbake-setup.schema.json diff --git a/meta/files/bitbake-setup.schema.json b/meta/files/bitbake-setup.schema.json new file mode 100644 index 0000000000..5101b0de53 --- /dev/null +++ b/meta/files/bitbake-setup.schema.json @@ -0,0 +1,108 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "Schema for bitbake-setup configuration files", + "type": "object", + "required": [ + "description", + "bitbake-setup", + "version" + ], + "properties": { + "description": { + "type": "string", + "description": "Description of the bitbake-setup configuration file" + }, + "sources": { + "$ref": "layers.schema.json#/properties/sources" + }, + "bitbake-setup": { + "type": "object", + "description": "BitBake-setup configurations", + "required": [ + "configurations" + ], + "properties": { + "configurations": { + "type": "array", + "minItems": 1, + "$anchor": "configurations", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the configuration" + }, + "description": { + "type": "string", + "description": "Human-readable description of the configuration" + }, + "bb-layers": { + "type": "array", + "description": "List of BitBake layers to include", + "items": { + "type": "string" + } + }, + "oe-template": { + "type": "string", + "description": "OE-template configuration" + }, + "oe-fragments": { + "$anchor": "oe-fragments", + "type": "array", + "description": "List of BitBake configuration fragments to enable", + "items": { + "type": "string" + } + }, + "oe-fragments-one-of": { + "type": "object", + "description": "Mutually exclusive bitbake configuration fragment", + "patternProperties": { + ".*": { + "type": "object", + "required": [ + "description", + "options" + ], + "properties": { + "description": { + "type": "string", + "description": "Human-readable description of the fragment category" + }, + "options": { + "$ref": "#oe-fragments" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "configurations": { + "$ref": "#configurations" + }, + "bb-env-passthrough-additions": { + "type": "array", + "description": "List of environment variables to include in BB_ENV_PASSTHROUGH_ADDITIONS", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "version": { + "description": "The version of this document; currently '1.0'", + "enum": [ + "1.0" + ] + } + }, + "additionalProperties": false +} From patchwork Thu Oct 23 07:25:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72882 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F8EFCCD193 for ; Thu, 23 Oct 2025 07:25:40 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.web11.14728.1761204339828097606 for ; Thu, 23 Oct 2025 00:25:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=2BHl6BZC; spf=pass (domain: smile.fr, ip: 209.85.128.41, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47106fc51faso6977335e9.0 for ; Thu, 23 Oct 2025 00:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1761204338; x=1761809138; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0/cAD6mCPKDSN05Q7NRzHXLsOfhZ0TYHKGoCneQ0X0g=; b=2BHl6BZCtOMU+JrE+vzRP3W1Uio167mjkwnnkS0+qSVwd8I9Mp6t2lyn7joDOmpy5R k5hnqsDX/ZJwB2MCZrsZ4mIaMFnsIdMgZTcsTrjceN+pjn1frMphEIvzXTKfQJkWZ0d2 7FCMIPqJdYD2gPNzOjVdOc8fY2yADtmws9kf4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761204338; x=1761809138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0/cAD6mCPKDSN05Q7NRzHXLsOfhZ0TYHKGoCneQ0X0g=; b=niIW12oJ4LGEdETdzrP4x+H2/VabmqWJwhp1f8zGZqbZMSNXhs5bZiOFwPwILKyuJx c1jMKFjKBORtj1LQqafRKEbfqI+qXOQAWnKNq8CbXOqyNsDtfZ5Nxtb5RPGhh40JEzcr s1rnH/BuY+22WocZJZTyV3OAyZEmpr9fvcJIQZGISA5WxMksJTr3yPaoY6fcgEax9xvN HLKURbURqbBOHyRVpWWID3c6r4qYuAr2mSql2TqBZeJxShBslgVhu+SFXOsuchbbIx/t JA6nesTOJ/Y1tMotrIJlG5oIUPLIiHd68ErB6/249/BKdwhdiy9gicu+8ZFuvv4+J3vE TodQ== X-Gm-Message-State: AOJu0YwaXXy3rHCjTyTcozoO8U6JL9oPaJezP0m4IYoB5IjqUTOc0exO 6C0BUA0nRpY6tZ3LfeHVRQ36WwlfbNofS2sOqZJH0aYXR7APRty3QFLLsvI0uPh6nZ9ohVRnd7a WC5owMkg= X-Gm-Gg: ASbGncsGs+n3O/msru/5ibzyWG2kFe7Ztcx2Yxavij+KiFBoNDEqbk3GPT9/xygYvwN /JKNGeCG8wnzQ76TEZuVL8X6J8/fSdDBEotMbKFTsUbrUStS5fFljE6IYekN2A0YcQqny9IgNcq awn/2rUN20NpCEv8Evrf0HJ4vLPmc0GhN91RB3Og+wBee8bs8uUeU4n08IMcpHF6PDF9EFtRGJU R/iBHYQluTSpMqT8J752sPOCeTXRtovQQ8UtHmbX8zxu7ccEE37Bd38XqNTAoX/R5jCPmF8gZpo aP8zc0u3vdY1J21Fofw4+MCLbkUHelPyP/wKWagE4RWTekj1q7XqdzPk3GC74USSDs3KZ0irqhI o+TDEFsLDpbGt32XBbxHRZmSp530tLIUifyv5BXsGF2FBmtx4h1XFmdb9C/v/GVKJxab77LA45f Gp+CYyfxdhB0GiYfLnjjp9lml4Fn19AXGmQRsHK0UtklqivgnE1e9GFZqmxaadDnsA/vz8w8mP8 RJe30apsThcaTTW X-Google-Smtp-Source: AGHT+IGUW1t2o1OGgb1M4uh85T49EGdo5YllQw+jm5oG18iQIOys8pXojMw7VSoJAPVME7Rmvjghlw== X-Received: by 2002:a05:6000:3107:b0:428:4354:aa26 with SMTP id ffacd0b85a97d-4284354ac40mr11027369f8f.47.1761204337898; Thu, 23 Oct 2025 00:25:37 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429898adf78sm2608818f8f.32.2025.10.23.00.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Oct 2025 00:25:37 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH 2/3] selftest/bblayers: Refactor JSON schema validation Date: Thu, 23 Oct 2025 09:25:12 +0200 Message-Id: <20251023072513.280477-2-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251023072513.280477-1-yoann.congal@smile.fr> References: <20251023072513.280477-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Oct 2025 07:25:40 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225221 From: Yoann Congal * Extract a function "validate_json" * Allow to specify the schema relative to $COREBASE/meta/files/ * Specify the Base URI to allow schema to reference each other Signed-off-by: Yoann Congal --- RFC: Maybe I should split this commit? --- meta/lib/oeqa/selftest/cases/bblayers.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 982287c9a5..43a158fcf2 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -136,15 +136,24 @@ class BitbakeLayers(OESelftestTestCase): self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe) return os.path.basename(recipe_file) - def validate_layersjson(self, json): - python = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native'), 'nativepython3') - jsonvalidator = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native'), 'jsonschema') - jsonschema = os.path.join(get_bb_var('COREBASE'), 'meta/files/layers.schema.json') - result = runCmd("{} {} -i {} {}".format(python, jsonvalidator, json, jsonschema)) + def validate_json(self, json, jsonschema): + staging_bindir = get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native') + python = os.path.join(staging_bindir, 'nativepython3') + jsonvalidator = os.path.join(staging_bindir, 'jsonschema') + schemas_dir = os.path.join(get_bb_var('COREBASE'), "meta/files/") + if not os.path.isabs(jsonschema): + jsonschema = os.path.join(schemas_dir, jsonschema) + + result = runCmd( + "{} {} -i {} --base-uri file://{}/ {}".format( + python, jsonvalidator, json, schemas_dir, jsonschema + ) + ) def test_validate_examplelayersjson(self): json = os.path.join(get_bb_var('COREBASE'), "meta/files/layers.example.json") - self.validate_layersjson(json) + jsonschema = "layers.schema.json" + self.validate_json(json, jsonschema) def test_bitbakelayers_setup(self): result = runCmd('bitbake-layers create-layers-setup {}'.format(self.testlayer_path)) From patchwork Thu Oct 23 07:25:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 72884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63AF8CCD1BC for ; Thu, 23 Oct 2025 07:25:50 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web10.14640.1761204340697464596 for ; Thu, 23 Oct 2025 00:25:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=N0M0vUUN; spf=pass (domain: smile.fr, ip: 209.85.221.46, mailfrom: yoann.congal@smile.fr) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3ecdf2b1751so317682f8f.0 for ; Thu, 23 Oct 2025 00:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1761204339; x=1761809139; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mZtPNR0XDxsBt2YVL97EBujU1CarkxDwhY5SF+029YQ=; b=N0M0vUUNDG1FQMgad0G2wYqecramMs04HOqPXmV7fEUF7ovwYock6RTA6EULpaYJuY Hi7a5Lk6pm4m0GG+GVfDpl9vEvRyYVSIkzkn+F74kqTVxThGa5GZuhoeiXOfsPeiDh/Y G2ajykp1lLQg1fyvcQnvB9QX8b1E2BhYOL5hs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761204339; x=1761809139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mZtPNR0XDxsBt2YVL97EBujU1CarkxDwhY5SF+029YQ=; b=q//v+llj/YK1q3/gElOIIrBTUC50e8hB81SQA58RE4bWkJYu1TX4kqOeG/fYaKXR+Q sVASQvtPKZM+by3PWgG5rcxeaSsaXwiv6l6DIodRK8RonlaKAFE/8uNP2ExWJz5hIYS5 mHf264l2uBW1i8ciX9/gKmapC/2esBdG1qTIxpCfGQENbU0+h0UuUP3WtuTpm+953YxD wyAq12hmSe66nITptGkiDE8NZbKdmEn+YTI9gOvkgpGQbU2oI0ldgiraSosYCp7xtICz P8MwSTdHEAslSGWxClOaplU+DHzJwXq2d6HJGxsY6TIKC8qNfXo2Ck0fMdueCh3lduDs N8EQ== X-Gm-Message-State: AOJu0YxfXhsa3htrrfMGZ83BOKVGyCNJPBfY2kYvmeU4fjzquwNLd00n ioN1TzUceGNJzNPkx67kwOZ9H0h9hPevK8yiQ+8T85vck6P6ux3mzn8iYGYdED3jJgVsDzYjD8N sHFz3yPs= X-Gm-Gg: ASbGncs4+H8+m84D0BN1wMTvFmDuySNCQ+SM15M7fu3t61T89YIfZtdi1EIeD62ym4m Z2TePbwQuE8Dwx0RfTHpshzEXXOFB3j6P4fnhWzmSwF55UIu03c3/G6rc12jtF5BDtwIBKqF2JW 8aOvm3atBvdTmQgmzb4yFO8OkfBVfTzNE3mgFXLeb3SqkrpGl7tybqvtBeuYozMVZ+hUlj+AZDw AnQYSFC2ByzUGQCAIWP6cFWOGgo+Xf/j4rAZLWzk/IUmZlWf7EW/gfMmqQ0j0LGDqrCcKCPob1F +27D6NoHMxnK0Cp9y6XQD/u+i+cC9zaDxALbHdEBO2nOtQpPpba8fU2cTcIPk8gdwziZbhBnBqJ EhJenA8lC0oN1VVyOMca/tDZOw6+PIOnO6h6f2Uql8BrGDM6Vb8Hg1SbkE4mwTxvuz4WS9IfR/G btOWYegFSaPf5Sa0jnNhj1y0y3lN1dmYrNwEyqA5qURCSiEcumodJwKXYrRSvMIoQTZm2Ivh8V6 DBero6L77+56v5X X-Google-Smtp-Source: AGHT+IH9HXOzM8I8U9VQDAgzFlBcMa3z4jCjv47c2/boulO0Jr2N+n5Btya6rEkeKy+e/p5A3kK1Yw== X-Received: by 2002:a05:6000:26d1:b0:425:75c6:7125 with SMTP id ffacd0b85a97d-42704d5219emr16435822f8f.16.1761204338856; Thu, 23 Oct 2025 00:25:38 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com. [176.157.204.145]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-429898adf78sm2608818f8f.32.2025.10.23.00.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Oct 2025 00:25:38 -0700 (PDT) From: Yoann Congal To: openembedded-core@lists.openembedded.org Cc: Yoann Congal Subject: [PATCH 3/3] selftest/bblayers: Add a test to validate bitbake-setup registry schema Date: Thu, 23 Oct 2025 09:25:13 +0200 Message-Id: <20251023072513.280477-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251023072513.280477-1-yoann.congal@smile.fr> References: <20251023072513.280477-1-yoann.congal@smile.fr> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 23 Oct 2025 07:25:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225222 From: Yoann Congal 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 121.119s INFO - OK INFO - RESULTS: INFO - RESULTS - bblayers.BitbakeLayers.test_validate_bitbake_setup_default_registry: PASSED (15.86s) INFO - RESULTS - bblayers.BitbakeLayers.test_validate_examplelayersjson: PASSED (7.12s) Signed-off-by: Yoann Congal --- 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. --- meta/lib/oeqa/selftest/cases/bblayers.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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")