diff options
author | Ross Burton <ross.burton@arm.com> | 2025-05-10 09:43:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-12 22:01:55 +0100 |
commit | d20341f93a13fc2f006b0c53eaaf39be153b2686 (patch) | |
tree | 8bf9a05db5460c2d3410c4e9d3056a80007c6846 | |
parent | 788ea3f7a18afabb310bae1d7bbee4f88e89a95c (diff) | |
download | poky-d20341f93a13fc2f006b0c53eaaf39be153b2686.tar.gz |
oeqa/selftest/sdk: add test to verify the manifests are generated correctly
Add a test that builds a SDK with specific packages in the host and
target sections, and verifies that they're listed in the manifest.
(From OE-Core rev: a1556c801feb56b79243ba2947b74b84f674072b)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sdk.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sdk.py b/meta/lib/oeqa/selftest/cases/sdk.py new file mode 100644 index 0000000000..3971365029 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/sdk.py | |||
@@ -0,0 +1,39 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | |||
7 | import os.path | ||
8 | |||
9 | from oeqa.selftest.case import OESelftestTestCase | ||
10 | from oeqa.utils.commands import bitbake, get_bb_vars | ||
11 | |||
12 | class SDKTests(OESelftestTestCase): | ||
13 | |||
14 | def load_manifest(self, filename): | ||
15 | manifest = {} | ||
16 | with open(filename) as f: | ||
17 | for line in f: | ||
18 | name, arch, version = line.split(maxsplit=3) | ||
19 | manifest[name] = (version, arch) | ||
20 | return manifest | ||
21 | |||
22 | def test_sdk_manifests(self): | ||
23 | image = "core-image-minimal" | ||
24 | |||
25 | self.write_config(""" | ||
26 | TOOLCHAIN_HOST_TASK:append = " nativesdk-selftest-hello" | ||
27 | IMAGE_INSTALL:append = " selftest-hello" | ||
28 | """) | ||
29 | |||
30 | bitbake(f"{image} -c populate_sdk") | ||
31 | vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAIN_OUTPUTNAME'], image) | ||
32 | |||
33 | path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".host.manifest") | ||
34 | self.assertNotEqual(os.path.getsize(path), 0, msg="Host manifest is empty") | ||
35 | self.assertIn("nativesdk-selftest-hello", self.load_manifest(path)) | ||
36 | |||
37 | path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".target.manifest") | ||
38 | self.assertNotEqual(os.path.getsize(path), 0, msg="Target manifest is empty") | ||
39 | self.assertIn("selftest-hello", self.load_manifest(path)) | ||