mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
selftest: Add multiconfig test
Add a test for a multiconfig build which mixes tiny and musl builds along with using the mcextend class to combine and package multiple images into another image. This gives the multiconfig a decent test in a scenario users may use. (From OE-Core rev: 0c7fa15a7350808242754944243f01155bc6784c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
|
||||
MCMACHINE_virtclass-mcextend-musl = "qemux86-64"
|
||||
MCMACHINE_virtclass-mcextend-tiny = "qemux86"
|
||||
MCIMGTYPE_virtclass-mcextend-musl = "ext4"
|
||||
MCIMGTYPE_virtclass-mcextend-tiny = "cpio.gz"
|
||||
|
||||
MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}"
|
||||
|
||||
do_install[mcdepends] += "multiconfig::${MCNAME}:core-image-minimal:do_image_complete multiconfig::${MCNAME}:virtual/kernel:do_deploy"
|
||||
|
||||
do_install () {
|
||||
install -d ${D}/var/lib/machines/${MCNAME}
|
||||
install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE}
|
||||
install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME}
|
||||
}
|
||||
|
||||
python () {
|
||||
mcname = d.getVar('MCNAME')
|
||||
if not mcname:
|
||||
raise bb.parse.SkipRecipe("Not a multiconfig target")
|
||||
multiconfigs = d.getVar('BBMULTICONFIG') or ""
|
||||
if mcname not in multiconfigs:
|
||||
raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname)
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "mcextend:tiny mcextend:musl"
|
||||
43
meta/lib/oeqa/selftest/cases/multiconfig.py
Normal file
43
meta/lib/oeqa/selftest/cases/multiconfig.py
Normal file
@@ -0,0 +1,43 @@
|
||||
import os
|
||||
from oeqa.selftest.case import OESelftestTestCase
|
||||
from oeqa.utils.commands import bitbake
|
||||
import oeqa.utils.ftools as ftools
|
||||
|
||||
class MultiConfig(OESelftestTestCase):
|
||||
|
||||
def test_multiconfig(self):
|
||||
"""
|
||||
Test that a simple multiconfig build works. This uses the mcextend class and the
|
||||
multiconfig-image-packager test recipe to build a core-image-full-cmdline image which
|
||||
contains a tiny core-image-minimal and a musl core-image-minimal, installed as packages.
|
||||
"""
|
||||
|
||||
config = """
|
||||
IMAGE_INSTALL_append_pn-core-image-full-cmdline = " multiconfig-image-packager-tiny multiconfig-image-packager-musl"
|
||||
BBMULTICONFIG = "tiny musl"
|
||||
"""
|
||||
self.write_config(config)
|
||||
|
||||
muslconfig = """
|
||||
MACHINE = "qemux86-64"
|
||||
DISTRO = "poky"
|
||||
TCLIBC = "musl"
|
||||
TMPDIR = "${TOPDIR}/tmp-mc-musl"
|
||||
"""
|
||||
|
||||
tinyconfig = """
|
||||
MACHINE = "qemux86"
|
||||
DISTRO = "poky-tiny"
|
||||
TMPDIR = "${TOPDIR}/tmp-mc-tiny"
|
||||
"""
|
||||
|
||||
multiconfigdir = self.builddir + "/conf/multiconfig"
|
||||
os.makedirs(multiconfigdir, exist_ok=True)
|
||||
self.track_for_cleanup(multiconfigdir + "/musl.conf")
|
||||
ftools.write_file(multiconfigdir + "/musl.conf", muslconfig)
|
||||
self.track_for_cleanup(multiconfigdir + "/tiny.conf")
|
||||
ftools.write_file(multiconfigdir + "/tiny.conf", tinyconfig)
|
||||
|
||||
# Build a core-image-minimal
|
||||
bitbake('core-image-full-cmdline')
|
||||
|
||||
Reference in New Issue
Block a user