summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/bblayers.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/bblayers.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py16
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 549abe7d10..c753a7b795 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -8,12 +8,16 @@ import os
8import re 8import re
9 9
10import oeqa.utils.ftools as ftools 10import oeqa.utils.ftools as ftools
11from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars 11from oeqa.utils.commands import runCmd, get_bb_var, get_bb_vars, bitbake
12 12
13from oeqa.selftest.case import OESelftestTestCase 13from oeqa.selftest.case import OESelftestTestCase
14 14
15class BitbakeLayers(OESelftestTestCase): 15class BitbakeLayers(OESelftestTestCase):
16 16
17 def setUpLocal(self):
18 bitbake("python3-jsonschema-native")
19 bitbake("-c addto_recipe_sysroot python3-jsonschema-native")
20
17 def test_bitbakelayers_layerindexshowdepends(self): 21 def test_bitbakelayers_layerindexshowdepends(self):
18 result = runCmd('bitbake-layers layerindex-show-depends meta-poky') 22 result = runCmd('bitbake-layers layerindex-show-depends meta-poky')
19 find_in_contents = re.search("openembedded-core", result.output) 23 find_in_contents = re.search("openembedded-core", result.output)
@@ -128,3 +132,13 @@ class BitbakeLayers(OESelftestTestCase):
128 132
129 self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe) 133 self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe)
130 return os.path.basename(recipe_file) 134 return os.path.basename(recipe_file)
135
136 def validate_layersjson(self, json):
137 python = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native'), 'nativepython3')
138 jsonvalidator = os.path.join(get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native'), 'jsonschema')
139 jsonschema = os.path.join(get_bb_var('COREBASE'), 'meta/files/layers.schema.json')
140 result = runCmd("{} {} -i {} {}".format(python, jsonvalidator, json, jsonschema))
141
142 def test_validate_examplelayersjson(self):
143 json = os.path.join(get_bb_var('COREBASE'), "meta/files/layers.example.json")
144 self.validate_layersjson(json)