diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-01 17:40:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-13 15:23:34 +0000 |
commit | 91de6ea10fcd66a37de9921a78b35172baa34b6c (patch) | |
tree | e9ffdf56318f986b020ec34ab03756c3b20e4634 | |
parent | a0614c91a7efc0bc50ec1891a12e524eaa8bce35 (diff) | |
download | poky-91de6ea10fcd66a37de9921a78b35172baa34b6c.tar.gz |
oeqa/selftest/tinfoil: Add test for separate config_data with recipe_parse_file()
We've seen two different regressions in this API since it is used by
layer-index but not be the core code. Add a test for it to try and
ensure we don't break it again.
(From OE-Core rev: 2816c63240f21b175461e535d88943fc6bcd0b52)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit b07de5de43ec9c9a2c5d496a64940ccdc5b47cf8)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/tinfoil.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/tinfoil.py b/meta/lib/oeqa/selftest/cases/tinfoil.py index c81d56d82b..4b261dad00 100644 --- a/meta/lib/oeqa/selftest/cases/tinfoil.py +++ b/meta/lib/oeqa/selftest/cases/tinfoil.py | |||
@@ -64,6 +64,20 @@ class TinfoilTests(OESelftestTestCase): | |||
64 | localdata.setVar('PN', 'hello') | 64 | localdata.setVar('PN', 'hello') |
65 | self.assertEqual('hello', localdata.getVar('BPN')) | 65 | self.assertEqual('hello', localdata.getVar('BPN')) |
66 | 66 | ||
67 | # The config_data API tp parse_recipe_file is used by: | ||
68 | # layerindex-web layerindex/update_layer.py | ||
69 | def test_parse_recipe_custom_data(self): | ||
70 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
71 | tinfoil.prepare(config_only=False, quiet=2) | ||
72 | localdata = bb.data.createCopy(tinfoil.config_data) | ||
73 | localdata.setVar("TESTVAR", "testval") | ||
74 | testrecipe = 'mdadm' | ||
75 | best = tinfoil.find_best_provider(testrecipe) | ||
76 | if not best: | ||
77 | self.fail('Unable to find recipe providing %s' % testrecipe) | ||
78 | rd = tinfoil.parse_recipe_file(best[3], config_data=localdata) | ||
79 | self.assertEqual("testval", rd.getVar('TESTVAR')) | ||
80 | |||
67 | def test_list_recipes(self): | 81 | def test_list_recipes(self): |
68 | with bb.tinfoil.Tinfoil() as tinfoil: | 82 | with bb.tinfoil.Tinfoil() as tinfoil: |
69 | tinfoil.prepare(config_only=False, quiet=2) | 83 | tinfoil.prepare(config_only=False, quiet=2) |