diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-03-16 10:45:29 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-20 11:03:43 +0000 |
commit | 7f536ba0c1593eff8a85d7d915f00c215bc93d49 (patch) | |
tree | b9e33064ddd6f7f904822b9c6b7cb4eeca276658 /meta | |
parent | 61e14ad4ebde3508db1ab0a70e77677d8aa571c6 (diff) | |
download | poky-7f536ba0c1593eff8a85d7d915f00c215bc93d49.tar.gz |
oe-selftest: improve bitbake-layers tests
* Add a test for add-layer and remove-layer
* Correct message for test_bitbakelayers_showoverlayed()
* Improve test_bitbakelayers_flatten() to use a more unique name for the
temp output directory and clean it up using track_for_cleanup()
(From OE-Core rev: c4ae1e2c98bee62fcc8db4849b6a4f9a5996a210)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/bblayers.py | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py index 449c17ea37..5b046d06e1 100644 --- a/meta/lib/oeqa/selftest/bblayers.py +++ b/meta/lib/oeqa/selftest/bblayers.py | |||
@@ -29,15 +29,32 @@ class BitbakeLayers(oeSelfTest): | |||
29 | @testcase(90) | 29 | @testcase(90) |
30 | def test_bitbakelayers_showoverlayed(self): | 30 | def test_bitbakelayers_showoverlayed(self): |
31 | result = runCmd('bitbake-layers show-overlayed') | 31 | result = runCmd('bitbake-layers show-overlayed') |
32 | self.assertTrue('aspell' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised') | 32 | self.assertTrue('aspell' in result.output, msg='aspell overlayed recipe was not recognised') |
33 | 33 | ||
34 | @testcase(95) | 34 | @testcase(95) |
35 | def test_bitbakelayers_flatten(self): | 35 | def test_bitbakelayers_flatten(self): |
36 | self.assertFalse(os.path.isdir(os.path.join(self.builddir, 'test'))) | 36 | testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten') |
37 | result = runCmd('bitbake-layers flatten test') | 37 | self.assertFalse(os.path.isdir(testoutdir)) |
38 | bb_file = os.path.join(self.builddir, 'test/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb') | 38 | self.track_for_cleanup(testoutdir) |
39 | result = runCmd('bitbake-layers flatten %s' % testoutdir) | ||
40 | bb_file = os.path.join(testoutdir, 'recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb') | ||
39 | self.assertTrue(os.path.isfile(bb_file)) | 41 | self.assertTrue(os.path.isfile(bb_file)) |
40 | contents = ftools.read_file(bb_file) | 42 | contents = ftools.read_file(bb_file) |
41 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) | 43 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) |
42 | shutil.rmtree(os.path.join(self.builddir, 'test')) | ||
43 | self.assertTrue(find_in_contents) | 44 | self.assertTrue(find_in_contents) |
45 | |||
46 | def test_bitbakelayers_add_remove(self): | ||
47 | result = runCmd('bitbake-layers show-layers') | ||
48 | self.assertNotIn('meta-skeleton', result.output, 'This test cannot run with meta-skeleton in bblayers.conf') | ||
49 | result = runCmd('bitbake-layers add-layer ../meta-skeleton') | ||
50 | result = runCmd('bitbake-layers show-layers') | ||
51 | self.assertIn('meta-skeleton', result.output) | ||
52 | result = runCmd('bitbake-layers remove-layer ../meta-skeleton') | ||
53 | result = runCmd('bitbake-layers show-layers') | ||
54 | self.assertNotIn('meta-skeleton', result.output) | ||
55 | result = runCmd('bitbake-layers add-layer ../meta-skeleton') | ||
56 | result = runCmd('bitbake-layers show-layers') | ||
57 | self.assertIn('meta-skeleton', result.output) | ||
58 | result = runCmd('bitbake-layers remove-layer */meta-skeleton') | ||
59 | result = runCmd('bitbake-layers show-layers') | ||
60 | self.assertNotIn('meta-skeleton', result.output) | ||