summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2024-11-13 00:11:26 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-15 11:16:59 +0000
commitea1775d0d49383a231dcc4eb2a1c28b429082573 (patch)
tree6459a93db03789be96e85b2f54928191fcbb901a /meta
parentbdd37c0186b9a88b882dac9b5a17784cd89f168c (diff)
downloadpoky-ea1775d0d49383a231dcc4eb2a1c28b429082573.tar.gz
oeqa/selftest: add a test for bitbake "-e" and "-getvar" difference
This is a non-regression test for [YOCTO #15638] (From OE-Core rev: 7fc2d0da51bfe51bc9d57a346369971f55acaaaa) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/bbtests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py b/meta/lib/oeqa/selftest/cases/bbtests.py
index 98e9f81661..1cec77b72c 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -375,3 +375,21 @@ require conf/distro/include/no-gplv3.inc
375 self.assertGreater(result.status, 0, "Build should have failed if ${ is in the path") 375 self.assertGreater(result.status, 0, "Build should have failed if ${ is in the path")
376 self.assertTrue(re.search("ERROR: Directory name /.* contains unexpanded bitbake variable. This may cause build failures and WORKDIR polution", 376 self.assertTrue(re.search("ERROR: Directory name /.* contains unexpanded bitbake variable. This may cause build failures and WORKDIR polution",
377 result.output), msg = "mkdirhier with unexpanded variable should have failed: %s" % result.output) 377 result.output), msg = "mkdirhier with unexpanded variable should have failed: %s" % result.output)
378
379 def test_bb_env_bb_getvar_equality(self):
380 """ Test if "bitbake -e" output is identical to "bitbake-getvar" output for a variable set from an anonymous function
381 """
382 self.write_config('''INHERIT += "test_anon_func"
383TEST_SET_FROM_ANON_FUNC ?= ""''')
384
385 result_bb_e = runCmd('bitbake -e')
386 bb_e_var_match = re.search('^TEST_SET_FROM_ANON_FUNC="(?P<value>.*)"$', result_bb_e.output, re.MULTILINE)
387 self.assertTrue(bb_e_var_match, msg = "Can't find TEST_SET_FROM_ANON_FUNC value in \"bitbake -e\" output")
388 bb_e_var_value = bb_e_var_match.group("value")
389
390 result_bb_getvar = runCmd('bitbake-getvar TEST_SET_FROM_ANON_FUNC --value')
391 bb_getvar_var_value = result_bb_getvar.output.strip()
392 self.assertEqual(bb_e_var_value, bb_getvar_var_value,
393 msg='''"bitbake -e" output differs from bitbake-getvar output for TEST_SET_FROM_ANON_FUNC (set from anonymous function)
394bitbake -e: "%s"
395bitbake-getvar: "%s"''' % (bb_e_var_value, bb_getvar_var_value))