summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-01 17:40:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-23 23:05:57 +0000
commite22869afef9016dbdd3469ed925653550c99602f (patch)
tree140fdf9893ac1243d86bc1d1a95a9959fce5dbff /meta/lib
parent876aca4260007cd0ed0790620235636b9a5db604 (diff)
downloadpoky-e22869afef9016dbdd3469ed925653550c99602f.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: 82e2b21f4a91c03203178a4d927c7c7feb930785) 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')
-rw-r--r--meta/lib/oeqa/selftest/cases/tinfoil.py14
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 0a66615fd1..dd13c20402 100644
--- a/meta/lib/oeqa/selftest/cases/tinfoil.py
+++ b/meta/lib/oeqa/selftest/cases/tinfoil.py
@@ -66,6 +66,20 @@ class TinfoilTests(OESelftestTestCase):
66 localdata.setVar('PN', 'hello') 66 localdata.setVar('PN', 'hello')
67 self.assertEqual('hello', localdata.getVar('BPN')) 67 self.assertEqual('hello', localdata.getVar('BPN'))
68 68
69 # The config_data API tp parse_recipe_file is used by:
70 # layerindex-web layerindex/update_layer.py
71 def test_parse_recipe_custom_data(self):
72 with bb.tinfoil.Tinfoil() as tinfoil:
73 tinfoil.prepare(config_only=False, quiet=2)
74 localdata = bb.data.createCopy(tinfoil.config_data)
75 localdata.setVar("TESTVAR", "testval")
76 testrecipe = 'mdadm'
77 best = tinfoil.find_best_provider(testrecipe)
78 if not best:
79 self.fail('Unable to find recipe providing %s' % testrecipe)
80 rd = tinfoil.parse_recipe_file(best[3], config_data=localdata)
81 self.assertEqual("testval", rd.getVar('TESTVAR'))
82
69 def test_list_recipes(self): 83 def test_list_recipes(self):
70 with bb.tinfoil.Tinfoil() as tinfoil: 84 with bb.tinfoil.Tinfoil() as tinfoil:
71 tinfoil.prepare(config_only=False, quiet=2) 85 tinfoil.prepare(config_only=False, quiet=2)