diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-06-05 22:15:35 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-10 12:30:01 +0100 |
commit | c90dd50939b8de3330e3c27577f3503ef6f24f10 (patch) | |
tree | d80d50ff332bdfa878d6f925715298d7d56dc239 /bitbake | |
parent | 59fb65f74293c5b2dba811b41f8e254d601f359b (diff) | |
download | poky-c90dd50939b8de3330e3c27577f3503ef6f24f10.tar.gz |
bitbake: bitbake: tests: Add tests for BBMASK in multiconfig
Adds a test to validate that multiconfigs can independently mask off
recipes by setting BBMASK. See the test description for further
information about how the test works.
(Bitbake rev: 513fc2dddf13d5e344162c26d89d2dde2fe85634)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
6 files changed, 28 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf index 5e451fc2c0..efebf001a9 100644 --- a/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf +++ b/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf | |||
@@ -1,7 +1,8 @@ | |||
1 | CACHE = "${TOPDIR}/cache" | 1 | CACHE = "${TOPDIR}/cache" |
2 | THISDIR = "${@os.path.dirname(d.getVar('FILE'))}" | 2 | THISDIR = "${@os.path.dirname(d.getVar('FILE'))}" |
3 | COREBASE := "${@os.path.normpath(os.path.dirname(d.getVar('FILE')+'/../../'))}" | 3 | COREBASE := "${@os.path.normpath(os.path.dirname(d.getVar('FILE')+'/../../'))}" |
4 | BBFILES = "${COREBASE}/recipes/*.bb" | 4 | EXTRA_BBFILES ?= "" |
5 | BBFILES = "${COREBASE}/recipes/*.bb ${EXTRA_BBFILES}" | ||
5 | PROVIDES = "${PN}" | 6 | PROVIDES = "${PN}" |
6 | PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0]}" | 7 | PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0]}" |
7 | PF = "${BB_CURRENT_MC}:${PN}" | 8 | PF = "${BB_CURRENT_MC}:${PN}" |
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf index ecf23e1c73..f34b8dcccf 100644 --- a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf +++ b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf | |||
@@ -1 +1,2 @@ | |||
1 | TMPDIR = "${TOPDIR}/mc1/" | 1 | TMPDIR = "${TOPDIR}/mc1/" |
2 | BBMASK += "recipes/fails-mc/fails-mc1.bb" | ||
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf index eef338e4cc..c3360fc5c8 100644 --- a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf +++ b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf | |||
@@ -1 +1,2 @@ | |||
1 | TMPDIR = "${TOPDIR}/mc2/" | 1 | TMPDIR = "${TOPDIR}/mc2/" |
2 | BBMASK += "recipes/fails-mc/fails-mc2.bb" | ||
diff --git a/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc1.bb b/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc1.bb new file mode 100644 index 0000000000..17a181fffb --- /dev/null +++ b/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc1.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | python () { | ||
2 | if d.getVar("BB_CURRENT_MC") == "mc1": | ||
3 | bb.fatal("Multiconfig is mc1") | ||
4 | } | ||
5 | |||
diff --git a/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc2.bb b/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc2.bb new file mode 100644 index 0000000000..cc69e7b82d --- /dev/null +++ b/bitbake/lib/bb/tests/runqueue-tests/recipes/fails-mc/fails-mc2.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | python () { | ||
2 | if d.getVar("BB_CURRENT_MC") == "mc2": | ||
3 | bb.fatal("Multiconfig is mc2") | ||
4 | } | ||
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py index 4ba12a0772..091b5e41e0 100644 --- a/bitbake/lib/bb/tests/runqueue.py +++ b/bitbake/lib/bb/tests/runqueue.py | |||
@@ -232,6 +232,21 @@ class RunQueueTests(unittest.TestCase): | |||
232 | expected.remove(x) | 232 | expected.remove(x) |
233 | self.assertEqual(set(tasks), set(expected)) | 233 | self.assertEqual(set(tasks), set(expected)) |
234 | 234 | ||
235 | def test_multiconfig_bbmask(self): | ||
236 | # This test validates that multiconfigs can independently mask off | ||
237 | # recipes they do not want with BBMASK. It works by having recipes | ||
238 | # that will fail to parse for mc1 and mc2, then making each multiconfig | ||
239 | # build the one that does parse. This ensures that the recipes are in | ||
240 | # each multiconfigs BBFILES, but each is masking only the one that | ||
241 | # doesn't parse | ||
242 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: | ||
243 | extraenv = { | ||
244 | "BBMULTICONFIG" : "mc1 mc2", | ||
245 | "BB_SIGNATURE_HANDLER" : "basic", | ||
246 | "EXTRA_BBFILES": "${COREBASE}/recipes/fails-mc/*.bb", | ||
247 | } | ||
248 | cmd = ["bitbake", "mc:mc1:fails-mc2", "mc:mc2:fails-mc1"] | ||
249 | self.run_bitbakecmd(cmd, tempdir, "", extraenv=extraenv) | ||
235 | 250 | ||
236 | @unittest.skipIf(sys.version_info < (3, 5, 0), 'Python 3.5 or later required') | 251 | @unittest.skipIf(sys.version_info < (3, 5, 0), 'Python 3.5 or later required') |
237 | def test_hashserv_single(self): | 252 | def test_hashserv_single(self): |