[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH 6/7] selftest/bblayers: add a test for creating a layer setup and using it to resto
From:       "Alexander Kanavin" <alex.kanavin () gmail ! com>
Date:       2022-08-31 11:14:00
Message-ID: 20220831111401.3330342-6-alex () linutronix ! de
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

This does a basic run-through of the bitbake-layers plugin, and the resulting json \
layer config and the layer setup script that uses it. Only poky is actually fetched \
by the script.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/lib/oeqa/selftest/cases/bblayers.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py \
b/meta/lib/oeqa/selftest/cases/bblayers.py index c753a7b795..18007764b3 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -142,3 +142,25 @@ class BitbakeLayers(OESelftestTestCase):
     def test_validate_examplelayersjson(self):
         json = os.path.join(get_bb_var('COREBASE'), \
"meta/files/layers.example.json")  self.validate_layersjson(json)
+
+    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") +        \
self.validate_layersjson(jsonfile) +
+        # The revision-under-test may not necessarily be available on the remote \
server, +        # so replace it with a stable release tag.
+        import json
+        with open(jsonfile) as f:
+            data = json.load(f)
+        for s in data['sources']:
+            data['sources'][s]['git-remote']['rev'] = 'yocto-4.0'
+        with open(jsonfile, 'w') as f:
+            json.dump(data, f)
+
+        testcheckoutdir = os.path.join(self.builddir, 'test-layer-checkout')
+        result = runCmd('{}/setup-layers --destdir {}'.format(self.testlayer_path, \
testcheckoutdir)) +        # May not necessarily be named 'poky' or \
'openembedded-core' +        oecoredir = os.listdir(testcheckoutdir)[0]
+        testcheckoutfile = os.path.join(testcheckoutdir, oecoredir, \
"oe-init-build-env") +        self.assertTrue(os.path.exists(testcheckoutfile), "File \
                {} not found in test layer checkout".format(testcheckoutfile))
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170106): https://lists.openembedded.org/g/openembedded-core/message/170106
Mute This Topic: https://lists.openembedded.org/mt/93368474/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic