summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
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-05 22:28:13 +0000
commitbfa318a8a95bff5f0fa46b3fc23bba54294956b1 (patch)
treee178feddf85946fae393c707ae9446532c9eeb1e /meta/lib/oeqa
parent1ba76de20bca63cec4ccaf04766dfd994a728c75 (diff)
downloadpoky-bfa318a8a95bff5f0fa46b3fc23bba54294956b1.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: b07de5de43ec9c9a2c5d496a64940ccdc5b47cf8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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)