diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/sdk.py')
-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)) | ||