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-06 23:15:59 +0100
commit2416da36ae8753d32adb7b001d20b0571c3a3b9d (patch)
treec699a9cbf105dad670efa051ddbc3c0248c02a97 /meta/lib/oeqa/selftest
parenta7c8099fec5aa361523c66065c0c50d44e4372b6 (diff)
downloadpoky-2416da36ae8753d32adb7b001d20b0571c3a3b9d.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: aea2d69d0533bf005cd58eb91fd9b3a3ae194610) 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):