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-23 23:05:45 +0000 |
commit | d0a8cd82f6b28bf08280af82f1ab19c4fb8c4f91 (patch) | |
tree | bb6a22aa708f48c01221cd2b346316eea480c934 /meta/lib/oeqa/selftest/cases/tinfoil.py | |
parent | e0919b7a1696765282daca6e4bccba49ef7c7668 (diff) | |
download | poky-d0a8cd82f6b28bf08280af82f1ab19c4fb8c4f91.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: cc8ec63310f9a936371ea1070cb257c926808755)
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>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/tinfoil.py')
-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 686ce7e6b9..6668d7cdc8 100644 --- a/meta/lib/oeqa/selftest/cases/tinfoil.py +++ b/meta/lib/oeqa/selftest/cases/tinfoil.py | |||
@@ -65,6 +65,20 @@ class TinfoilTests(OESelftestTestCase): | |||
65 | localdata.setVar('PN', 'hello') | 65 | localdata.setVar('PN', 'hello') |
66 | self.assertEqual('hello', localdata.getVar('BPN')) | 66 | self.assertEqual('hello', localdata.getVar('BPN')) |
67 | 67 | ||
68 | # The config_data API tp parse_recipe_file is used by: | ||
69 | # layerindex-web layerindex/update_layer.py | ||
70 | def test_parse_recipe_custom_data(self): | ||
71 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
72 | tinfoil.prepare(config_only=False, quiet=2) | ||
73 | localdata = bb.data.createCopy(tinfoil.config_data) | ||
74 | localdata.setVar("TESTVAR", "testval") | ||
75 | testrecipe = 'mdadm' | ||
76 | best = tinfoil.find_best_provider(testrecipe) | ||
77 | if not best: | ||
78 | self.fail('Unable to find recipe providing %s' % testrecipe) | ||
79 | rd = tinfoil.parse_recipe_file(best[3], config_data=localdata) | ||
80 | self.assertEqual("testval", rd.getVar('TESTVAR')) | ||
81 | |||
68 | def test_list_recipes(self): | 82 | def test_list_recipes(self): |
69 | with bb.tinfoil.Tinfoil() as tinfoil: | 83 | with bb.tinfoil.Tinfoil() as tinfoil: |
70 | tinfoil.prepare(config_only=False, quiet=2) | 84 | tinfoil.prepare(config_only=False, quiet=2) |