self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_VARIABLE'), None)
self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_ANOTHER_VARIABLE'), None)
+ def test_enable_disable_builtin_fragments(self):
+ """
+ Tests that the meta-selftest properly adds a new built-in fragment from
+ its layer.conf configuration file.
+ The test sequence goes as follows:
+ 1. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set yet.
+ 2. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting
+ the fragment.
+ 3. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting
+ the fragment with another value that overrides the first one.
+ 4. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set to the previous
+ value after removing the second assignment (from step 3).
+ 5. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set after
+ removing the original assignment.
+ """
+ self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None)
+
+ runCmd('bitbake-config-build enable-fragment selftest-fragment/somevalue')
+ self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue')
+
+ runCmd('bitbake-config-build enable-fragment selftest-fragment/someothervalue')
+ self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'someothervalue')
+
+ runCmd('bitbake-config-build disable-fragment selftest-fragment/someothervalue')
+ self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue')
+
+ runCmd('bitbake-config-build disable-fragment selftest-fragment/somevalue')
+ self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None)
+
def test_show_fragment(self):
"""
Test that bitbake-config-build show-fragment returns the expected