summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2025-10-02 18:16:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-04 11:16:44 +0100
commitaeb0078d5dc03bde4d3ae3693bf01250f8fb91f4 (patch)
treeada46d5add9bbb4ef788c2d1c60f1490e8af1c00 /meta/lib/oeqa/selftest
parent69f24b64121db6347ad8658cfdb5108c03c301d8 (diff)
downloadpoky-aeb0078d5dc03bde4d3ae3693bf01250f8fb91f4.tar.gz
lib/bbconfigbuild/configfragments: disable the previous builtin fragment when enabling a new one
There was a flaw in the logic that allowed multiple builtin fragments with the same prefix to be enabled at the same time. The correct behaviour is that only one of them should be enabled, and when enabling it all previously enabled fragments should be removed. The issues that this caused are further explained in https://bugzilla.yoctoproject.org/show_bug.cgi?id=15987 [YOCTO #15987] (From OE-Core rev: 4cc78af26d8c3154d4f2b3b37d8e4dc65485eb66) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/bblayers.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py
index d82c5aaf37..7eb176aa04 100644
--- a/meta/lib/oeqa/selftest/cases/bblayers.py
+++ b/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -281,11 +281,11 @@ class BitbakeConfigBuild(OESelftestTestCase):
281 2. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting 281 2. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting
282 the fragment. 282 the fragment.
283 3. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting 283 3. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting
284 the fragment with another value that overrides the first one. 284 the fragment with another value that replaces the first one.
285 4. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set to the previous 285 4. Repeat steps 2 and 3 to verify that going back and forth between values
286 value after removing the second assignment (from step 3). 286 works.
287 5. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set after 287 5. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set after
288 removing the original assignment. 288 removing the final assignment.
289 """ 289 """
290 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None) 290 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None)
291 291
@@ -295,10 +295,13 @@ class BitbakeConfigBuild(OESelftestTestCase):
295 runCmd('bitbake-config-build enable-fragment selftest-fragment/someothervalue') 295 runCmd('bitbake-config-build enable-fragment selftest-fragment/someothervalue')
296 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'someothervalue') 296 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'someothervalue')
297 297
298 runCmd('bitbake-config-build disable-fragment selftest-fragment/someothervalue') 298 runCmd('bitbake-config-build enable-fragment selftest-fragment/somevalue')
299 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue') 299 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue')
300 300
301 runCmd('bitbake-config-build disable-fragment selftest-fragment/somevalue') 301 runCmd('bitbake-config-build enable-fragment selftest-fragment/someothervalue')
302 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'someothervalue')
303
304 runCmd('bitbake-config-build disable-fragment selftest-fragment/someothervalue')
302 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None) 305 self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None)
303 306
304 def test_show_fragment(self): 307 def test_show_fragment(self):