mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
788ea3f7a1
commit
d20341f93a
@@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# Copyright OpenEmbedded Contributors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
|
||||||
|
from oeqa.selftest.case import OESelftestTestCase
|
||||||
|
from oeqa.utils.commands import bitbake, get_bb_vars
|
||||||
|
|
||||||
|
class SDKTests(OESelftestTestCase):
|
||||||
|
|
||||||
|
def load_manifest(self, filename):
|
||||||
|
manifest = {}
|
||||||
|
with open(filename) as f:
|
||||||
|
for line in f:
|
||||||
|
name, arch, version = line.split(maxsplit=3)
|
||||||
|
manifest[name] = (version, arch)
|
||||||
|
return manifest
|
||||||
|
|
||||||
|
def test_sdk_manifests(self):
|
||||||
|
image = "core-image-minimal"
|
||||||
|
|
||||||
|
self.write_config("""
|
||||||
|
TOOLCHAIN_HOST_TASK:append = " nativesdk-selftest-hello"
|
||||||
|
IMAGE_INSTALL:append = " selftest-hello"
|
||||||
|
""")
|
||||||
|
|
||||||
|
bitbake(f"{image} -c populate_sdk")
|
||||||
|
vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAIN_OUTPUTNAME'], image)
|
||||||
|
|
||||||
|
path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".host.manifest")
|
||||||
|
self.assertNotEqual(os.path.getsize(path), 0, msg="Host manifest is empty")
|
||||||
|
self.assertIn("nativesdk-selftest-hello", self.load_manifest(path))
|
||||||
|
|
||||||
|
path = os.path.join(vars["SDK_DEPLOY"], vars["TOOLCHAIN_OUTPUTNAME"] + ".target.manifest")
|
||||||
|
self.assertNotEqual(os.path.getsize(path), 0, msg="Target manifest is empty")
|
||||||
|
self.assertIn("selftest-hello", self.load_manifest(path))
|
||||||
Reference in New Issue
Block a user