diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-02 15:00:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-04 14:27:06 +0000 |
commit | d9018a3d9c828551c465b68b27920ec4681524ae (patch) | |
tree | 0c465540b35de4d76bcc57845ec1f5613b2eadf8 | |
parent | d22b6e03a5504145abed7c2ca44cf12854df85da (diff) | |
download | poky-d9018a3d9c828551c465b68b27920ec4681524ae.tar.gz |
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>
-rw-r--r-- | meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb | 28 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/multiconfig.py | 43 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb new file mode 100644 index 0000000000..3dbc0f5d15 --- /dev/null +++ b/meta-selftest/recipes-test/multiconfig/multiconfig-image-packager_0.1.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | LICENSE = "MIT" | ||
2 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
3 | |||
4 | MCMACHINE_virtclass-mcextend-musl = "qemux86-64" | ||
5 | MCMACHINE_virtclass-mcextend-tiny = "qemux86" | ||
6 | MCIMGTYPE_virtclass-mcextend-musl = "ext4" | ||
7 | MCIMGTYPE_virtclass-mcextend-tiny = "cpio.gz" | ||
8 | |||
9 | MC_DEPLOY_DIR_IMAGE = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/images/${MCMACHINE}" | ||
10 | |||
11 | do_install[mcdepends] += "multiconfig::${MCNAME}:core-image-minimal:do_image_complete multiconfig::${MCNAME}:virtual/kernel:do_deploy" | ||
12 | |||
13 | do_install () { | ||
14 | install -d ${D}/var/lib/machines/${MCNAME} | ||
15 | install ${MC_DEPLOY_DIR_IMAGE}/core-image-minimal-${MCMACHINE}.${MCIMGTYPE} ${D}/var/lib/machines/${MCNAME}/core-image-minimal.${MCIMGTYPE} | ||
16 | install ${MC_DEPLOY_DIR_IMAGE}/bzImage ${D}/var/lib/machines/${MCNAME} | ||
17 | } | ||
18 | |||
19 | python () { | ||
20 | mcname = d.getVar('MCNAME') | ||
21 | if not mcname: | ||
22 | raise bb.parse.SkipRecipe("Not a multiconfig target") | ||
23 | multiconfigs = d.getVar('BBMULTICONFIG') or "" | ||
24 | if mcname not in multiconfigs: | ||
25 | raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname) | ||
26 | } | ||
27 | |||
28 | BBCLASSEXTEND = "mcextend:tiny mcextend:musl" | ||
diff --git a/meta/lib/oeqa/selftest/cases/multiconfig.py b/meta/lib/oeqa/selftest/cases/multiconfig.py new file mode 100644 index 0000000000..3c36f6e5d2 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/multiconfig.py | |||
@@ -0,0 +1,43 @@ | |||
1 | import os | ||
2 | from oeqa.selftest.case import OESelftestTestCase | ||
3 | from oeqa.utils.commands import bitbake | ||
4 | import oeqa.utils.ftools as ftools | ||
5 | |||
6 | class MultiConfig(OESelftestTestCase): | ||
7 | |||
8 | def test_multiconfig(self): | ||
9 | """ | ||
10 | Test that a simple multiconfig build works. This uses the mcextend class and the | ||
11 | multiconfig-image-packager test recipe to build a core-image-full-cmdline image which | ||
12 | contains a tiny core-image-minimal and a musl core-image-minimal, installed as packages. | ||
13 | """ | ||
14 | |||
15 | config = """ | ||
16 | IMAGE_INSTALL_append_pn-core-image-full-cmdline = " multiconfig-image-packager-tiny multiconfig-image-packager-musl" | ||
17 | BBMULTICONFIG = "tiny musl" | ||
18 | """ | ||
19 | self.write_config(config) | ||
20 | |||
21 | muslconfig = """ | ||
22 | MACHINE = "qemux86-64" | ||
23 | DISTRO = "poky" | ||
24 | TCLIBC = "musl" | ||
25 | TMPDIR = "${TOPDIR}/tmp-mc-musl" | ||
26 | """ | ||
27 | |||
28 | tinyconfig = """ | ||
29 | MACHINE = "qemux86" | ||
30 | DISTRO = "poky-tiny" | ||
31 | TMPDIR = "${TOPDIR}/tmp-mc-tiny" | ||
32 | """ | ||
33 | |||
34 | multiconfigdir = self.builddir + "/conf/multiconfig" | ||
35 | os.makedirs(multiconfigdir, exist_ok=True) | ||
36 | self.track_for_cleanup(multiconfigdir + "/musl.conf") | ||
37 | ftools.write_file(multiconfigdir + "/musl.conf", muslconfig) | ||
38 | self.track_for_cleanup(multiconfigdir + "/tiny.conf") | ||
39 | ftools.write_file(multiconfigdir + "/tiny.conf", tinyconfig) | ||
40 | |||
41 | # Build a core-image-minimal | ||
42 | bitbake('core-image-full-cmdline') | ||
43 | |||