diff options
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/cases/multiconfig.py')
-rw-r--r-- | poky/meta/lib/oeqa/selftest/cases/multiconfig.py | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/multiconfig.py b/poky/meta/lib/oeqa/selftest/cases/multiconfig.py index d21bf0a41..39b92f243 100644 --- a/poky/meta/lib/oeqa/selftest/cases/multiconfig.py +++ b/poky/meta/lib/oeqa/selftest/cases/multiconfig.py @@ -3,16 +3,16 @@ # import os +import textwrap 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 + 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. """ @@ -28,20 +28,45 @@ DISTRO = "poky" TCLIBC = "musl" TMPDIR = "${TOPDIR}/tmp-mc-musl" """ + self.write_config(muslconfig, '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) + self.write_config(tinyconfig, 'tiny') # Build a core-image-minimal bitbake('core-image-full-cmdline') + def test_multiconfig_reparse(self): + """ + Test that changes to a multiconfig conf file are correctly detected and + cause a reparse/rebuild of a recipe. + """ + config = textwrap.dedent('''\ + MCTESTVAR = "test" + BBMULTICONFIG = "test" + ''') + self.write_config(config) + + testconfig = textwrap.dedent('''\ + MCTESTVAR_append = "1" + ''') + self.write_config(testconfig, 'test') + + # Check that the 1) the task executed and 2) that it output the correct + # value. Note "bitbake -e" is not used because it always reparses the + # recipe and we want to ensure that the automatic reparsing and parse + # caching is detected. + result = bitbake('mc:test:multiconfig-test-parse -c showvar') + self.assertIn('MCTESTVAR=test1', result.output.splitlines()) + + testconfig = textwrap.dedent('''\ + MCTESTVAR_append = "2" + ''') + self.write_config(testconfig, 'test') + + result = bitbake('mc:test:multiconfig-test-parse -c showvar') + self.assertIn('MCTESTVAR=test2', result.output.splitlines()) |