new file mode 100644
@@ -0,0 +1,115 @@
+{
+ "sources": {
+ "meta-alex": {
+ "contains_this_file": true,
+ "git-remote": {
+ "branch": "master",
+ "describe": "",
+ "remotes": {
+ "remote-alex": {
+ "uri": "https://github.com/kanavin/meta-alex"
+ }
+ },
+ "rev": "05b25605fb8b2399e4706d7323828676bf0da0b5"
+ },
+ "layers": {
+ "meta-alex": {
+ "buildconfigs": {
+ "conf/templates/configuration-gadget": {},
+ "conf/templates/configuration-gizmo": {}
+ },
+ "subpath": ""
+ }
+ },
+ "path": "meta-alex"
+ },
+ "meta-intel": {
+ "git-remote": {
+ "branch": "master",
+ "describe": "15.0-hardknott-3.3-310-g0a96edae",
+ "remotes": {
+ "origin": {
+ "uri": "git://git.yoctoproject.org/meta-intel"
+ }
+ },
+ "rev": "0a96edae609a3f48befac36af82cf1eed6786b4a"
+ },
+ "layers": {
+ "meta-intel": {
+ "machines": {
+ "intel-core2-32": {},
+ "intel-corei7-64": {},
+ "intel-skylake-64": {}
+ },
+ "subpath": ""
+ }
+ },
+ "path": "meta-intel"
+ },
+ "poky": {
+ "git-remote": {
+ "branch": "akanavin/setup-layers",
+ "describe": "4.1_M1-374-g9dda719b2a",
+ "remotes": {
+ "origin": {
+ "uri": "git://git.yoctoproject.org/poky"
+ },
+ "poky-contrib": {
+ "uri": "ssh://git@push.yoctoproject.org/poky-contrib"
+ }
+ },
+ "rev": "9dda719b2a4727a4d43a6ab8d9e23f8ca68790ec"
+ },
+ "layers": {
+ "meta": {
+ "distros": {
+ "defaultsetup": {}
+ },
+ "machines": {
+ "qemuarm": {},
+ "qemuarm64": {},
+ "qemuarmv5": {},
+ "qemumips": {},
+ "qemumips64": {},
+ "qemuppc": {},
+ "qemuppc64": {},
+ "qemuriscv32": {},
+ "qemuriscv64": {},
+ "qemux86": {},
+ "qemux86-64": {}
+ },
+ "subpath": "meta"
+ },
+ "meta-poky": {
+ "buildconfigs": {
+ "conf": {}
+ },
+ "distros": {
+ "poky": {},
+ "poky-altcfg": {},
+ "poky-bleeding": {},
+ "poky-tiny": {}
+ },
+ "subpath": "meta-poky"
+ },
+ "meta-selftest": {
+ "machines": {
+ "qemux86copy": {}
+ },
+ "subpath": "meta-selftest"
+ },
+ "meta-yocto-bsp": {
+ "machines": {
+ "beaglebone-yocto": {},
+ "edgerouter": {},
+ "genericx86": {},
+ "genericx86-64": {}
+ },
+ "subpath": "meta-yocto-bsp"
+ }
+ },
+ "path": "poky"
+ }
+ },
+ "version": "1.0"
+}
new file mode 100644
@@ -0,0 +1,121 @@
+{
+ "description": "OpenEmbedder Layer Setup Manifest",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "version"
+ ],
+ "properties": {
+ "version": {
+ "description": "The version of this document; currently '1.0'",
+ "enum": ["1.0"]
+ },
+ "sources": {
+ "description": "The dict of layer sources",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "type": "object",
+ "description": "The upstream source from which a set of layers may be fetched",
+ "additionalProperties": false,
+ "required": [
+ "path"
+ ],
+ "properties": {
+ "path": {
+ "description": "The path where this layer source will be placed when fetching",
+ "type": "string"
+ },
+ "contains_this_file": {
+ "description": "Whether the directory with the layer source also contains this json description. Tools may want to skip the checkout of the source then.",
+ "type": "boolean"
+ },
+ "layers": {
+ "description": "The dict of layers to be used from this upstream source",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "description": "A layer from the upstream source",
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "subpath": {
+ "description": "The subpath (relative to the source root) for this layer. Omit if the source root is the layer path",
+ "type": "string"
+ },
+ "buildconfigs": {
+ "description": "A dict of template build configurations in the layer, keyed by relative path to the layer root",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "description": "Properties of a build confuguration template",
+ "type": "object",
+ "additionalProperties": false,
+ "properties":{}
+ }}
+ },
+ "machines": {
+ "description": "A dict of machine definitions in the layer",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "description": "Properties of a machine definition",
+ "type": "object",
+ "additionalProperties": false,
+ "properties":{}
+ }}
+ },
+ "distros": {
+ "description": "A dict of distro definitions in the layer",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "description": "Properties of a distro definition",
+ "type": "object",
+ "additionalProperties": false,
+ "properties":{}
+ }}
+ }
+ }
+ }}
+ },
+ "git-remote": {
+ "description": "A remote git source from which to fetch",
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "rev"
+ ],
+ "properties": {
+ "branch": {
+ "description": "The git branch to fetch (optional)",
+ "type": "string"
+ },
+ "rev": {
+ "description": "The git revision to checkout",
+ "type": "string"
+ },
+ "describe": {
+ "description": "The output of 'git describe' (human readable description of the revision using tags in revision history).",
+ "type": "string"
+ },
+ "remotes": {
+ "description": "The dict of git remotes to add to this repository",
+ "type": "object",
+ "patternProperties": { ".*" : {
+ "description": "A git remote",
+ "type": "object",
+ "addtionalProperties": false,
+ "required": [
+ "uri"
+ ],
+ "properties": {
+ "uri": {
+ "description": "The URI for the remote",
+ "type": "string"
+ }
+ }
+ }}
+ }
+ }
+ }
+ }
+ }
+ }}
+ }
+}
@@ -6,12 +6,16 @@ import os
import re
import oeqa.utils.ftools as ftools
-from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars
+from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars, bitbake
from oeqa.selftest.case import OESelftestTestCase
class BitbakeLayers(OESelftestTestCase):
+ def setUpLocal(self):
+ bitbake("python3-jsonschema-native")
+ bitbake("-c addto_recipe_sysroot python3-jsonschema-native")
+
def test_bitbakelayers_layerindexshowdepends(self):
result = runCmd('bitbake-layers layerindex-show-depends meta-poky')
find_in_contents = re.search("openembedded-core", result.output)
@@ -126,3 +130,13 @@ 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 test_validate_examplelayersjson(self):
+ json = os.path.join(get_bb_var('COREBASE'), "meta/files/layers.example.json")
+ self.validate_layersjson(json)