Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: MIT |
| 3 | # |
| 4 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | import os |
| 6 | from oeqa.selftest.case import OESelftestTestCase |
| 7 | from oeqa.utils.commands import bitbake |
| 8 | import oeqa.utils.ftools as ftools |
| 9 | |
| 10 | class MultiConfig(OESelftestTestCase): |
| 11 | |
| 12 | def test_multiconfig(self): |
| 13 | """ |
| 14 | Test that a simple multiconfig build works. This uses the mcextend class and the |
| 15 | multiconfig-image-packager test recipe to build a core-image-full-cmdline image which |
| 16 | contains a tiny core-image-minimal and a musl core-image-minimal, installed as packages. |
| 17 | """ |
| 18 | |
| 19 | config = """ |
| 20 | IMAGE_INSTALL_append_pn-core-image-full-cmdline = " multiconfig-image-packager-tiny multiconfig-image-packager-musl" |
| 21 | BBMULTICONFIG = "tiny musl" |
| 22 | """ |
| 23 | self.write_config(config) |
| 24 | |
| 25 | muslconfig = """ |
| 26 | MACHINE = "qemux86-64" |
| 27 | DISTRO = "poky" |
| 28 | TCLIBC = "musl" |
| 29 | TMPDIR = "${TOPDIR}/tmp-mc-musl" |
| 30 | """ |
| 31 | |
| 32 | tinyconfig = """ |
| 33 | MACHINE = "qemux86" |
| 34 | DISTRO = "poky-tiny" |
| 35 | TMPDIR = "${TOPDIR}/tmp-mc-tiny" |
| 36 | """ |
| 37 | |
| 38 | multiconfigdir = self.builddir + "/conf/multiconfig" |
| 39 | os.makedirs(multiconfigdir, exist_ok=True) |
| 40 | self.track_for_cleanup(multiconfigdir + "/musl.conf") |
| 41 | ftools.write_file(multiconfigdir + "/musl.conf", muslconfig) |
| 42 | self.track_for_cleanup(multiconfigdir + "/tiny.conf") |
| 43 | ftools.write_file(multiconfigdir + "/tiny.conf", tinyconfig) |
| 44 | |
| 45 | # Build a core-image-minimal |
| 46 | bitbake('core-image-full-cmdline') |
| 47 | |