summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/multiconfig.py
blob: d21bf0a4110ddad12a1795c5f5895596c7eaf034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# SPDX-License-Identifier: MIT
#

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')