diff options
| -rw-r--r-- | meta-selftest/conf/layer.conf | 2 | ||||
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/bblayers.py | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/meta-selftest/conf/layer.conf b/meta-selftest/conf/layer.conf index ecc45ded8c..de7d6340ed 100644 --- a/meta-selftest/conf/layer.conf +++ b/meta-selftest/conf/layer.conf | |||
| @@ -12,3 +12,5 @@ BBFILE_PRIORITY_selftest = "5" | |||
| 12 | addpylib ${LAYERDIR}/lib oeqa | 12 | addpylib ${LAYERDIR}/lib oeqa |
| 13 | 13 | ||
| 14 | LAYERSERIES_COMPAT_selftest = "whinlatter" | 14 | LAYERSERIES_COMPAT_selftest = "whinlatter" |
| 15 | |||
| 16 | OE_FRAGMENTS_BUILTIN:append = " selftest-fragment:SELFTEST_BUILTIN_FRAGMENT_VARIABLE" | ||
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 8c05ec5d3d..d82c5aaf37 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
| @@ -272,6 +272,35 @@ class BitbakeConfigBuild(OESelftestTestCase): | |||
| 272 | self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_VARIABLE'), None) | 272 | self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_VARIABLE'), None) |
| 273 | self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_ANOTHER_VARIABLE'), None) | 273 | self.assertEqual(get_bb_var('SELFTEST_FRAGMENT_ANOTHER_VARIABLE'), None) |
| 274 | 274 | ||
| 275 | def test_enable_disable_builtin_fragments(self): | ||
| 276 | """ | ||
| 277 | Tests that the meta-selftest properly adds a new built-in fragment from | ||
| 278 | its layer.conf configuration file. | ||
| 279 | The test sequence goes as follows: | ||
| 280 | 1. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set yet. | ||
| 281 | 2. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting | ||
| 282 | the fragment. | ||
| 283 | 3. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set after setting | ||
| 284 | the fragment with another value that overrides the first one. | ||
| 285 | 4. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is set to the previous | ||
| 286 | value after removing the second assignment (from step 3). | ||
| 287 | 5. Verify that SELFTEST_BUILTIN_FRAGMENT_VARIABLE is not set after | ||
| 288 | removing the original assignment. | ||
| 289 | """ | ||
| 290 | self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None) | ||
| 291 | |||
| 292 | runCmd('bitbake-config-build enable-fragment selftest-fragment/somevalue') | ||
| 293 | self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue') | ||
| 294 | |||
| 295 | runCmd('bitbake-config-build enable-fragment selftest-fragment/someothervalue') | ||
| 296 | self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'someothervalue') | ||
| 297 | |||
| 298 | runCmd('bitbake-config-build disable-fragment selftest-fragment/someothervalue') | ||
| 299 | self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), 'somevalue') | ||
| 300 | |||
| 301 | runCmd('bitbake-config-build disable-fragment selftest-fragment/somevalue') | ||
| 302 | self.assertEqual(get_bb_var('SELFTEST_BUILTIN_FRAGMENT_VARIABLE'), None) | ||
| 303 | |||
| 275 | def test_show_fragment(self): | 304 | def test_show_fragment(self): |
| 276 | """ | 305 | """ |
| 277 | Test that bitbake-config-build show-fragment returns the expected | 306 | Test that bitbake-config-build show-fragment returns the expected |
