summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/bblayers.py27
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)