summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorCostin Constantin <costin.c.constantin@intel.com>2015-07-14 14:31:10 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-16 15:09:24 +0100
commiteeed010b177946d64ff14b20a2d75d8770a666ee (patch)
treecffb21b6e12e2319066bc302e49d7008ddcd5a30 /meta/lib/oeqa/selftest
parent2606cd277484f282386232189d11393b08176a0c (diff)
downloadpoky-eeed010b177946d64ff14b20a2d75d8770a666ee.tar.gz
oeqa/bblayers.py: add useful failure messages to all test cases
(From OE-Core rev: 3d157c146659a9b976e61ae93d766773f9f21b4f) Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/bblayers.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py
index bf3dd1b083..20c17e46fb 100644
--- a/meta/lib/oeqa/selftest/bblayers.py
+++ b/meta/lib/oeqa/selftest/bblayers.py
@@ -14,49 +14,49 @@ class BitbakeLayers(oeSelfTest):
14 @testcase(756) 14 @testcase(756)
15 def test_bitbakelayers_showcrossdepends(self): 15 def test_bitbakelayers_showcrossdepends(self):
16 result = runCmd('bitbake-layers show-cross-depends') 16 result = runCmd('bitbake-layers show-cross-depends')
17 self.assertTrue('aspell' in result.output) 17 self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output)
18 18
19 @testcase(83) 19 @testcase(83)
20 def test_bitbakelayers_showlayers(self): 20 def test_bitbakelayers_showlayers(self):
21 result = runCmd('bitbake-layers show-layers') 21 result = runCmd('bitbake-layers show-layers')
22 self.assertTrue('meta-selftest' in result.output) 22 self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output)
23 23
24 @testcase(93) 24 @testcase(93)
25 def test_bitbakelayers_showappends(self): 25 def test_bitbakelayers_showappends(self):
26 result = runCmd('bitbake-layers show-appends') 26 result = runCmd('bitbake-layers show-appends')
27 self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised') 27 self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg="xcursor-transparent-theme_0.1.1.bbappend file was not recognised. bitbake-layers show-appends output: %s" % result.output)
28 28
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='aspell overlayed recipe was not recognised') 32 self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output)
33 33
34 @testcase(95) 34 @testcase(95)
35 def test_bitbakelayers_flatten(self): 35 def test_bitbakelayers_flatten(self):
36 testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten') 36 testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten')
37 self.assertFalse(os.path.isdir(testoutdir)) 37 self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time")
38 self.track_for_cleanup(testoutdir) 38 self.track_for_cleanup(testoutdir)
39 result = runCmd('bitbake-layers flatten %s' % 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') 40 bb_file = os.path.join(testoutdir, 'recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
41 self.assertTrue(os.path.isfile(bb_file)) 41 self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
42 contents = ftools.read_file(bb_file) 42 contents = ftools.read_file(bb_file)
43 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)
44 self.assertTrue(find_in_contents) 44 self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
45 45
46 @testcase(1195) 46 @testcase(1195)
47 def test_bitbakelayers_add_remove(self): 47 def test_bitbakelayers_add_remove(self):
48 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton') 48 test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
49 result = runCmd('bitbake-layers show-layers') 49 result = runCmd('bitbake-layers show-layers')
50 self.assertNotIn('meta-skeleton', result.output, 'This test cannot run with meta-skeleton in bblayers.conf') 50 self.assertNotIn('meta-skeleton', result.output, "This test cannot run with meta-skeleton in bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
51 result = runCmd('bitbake-layers add-layer %s' % test_layer) 51 result = runCmd('bitbake-layers add-layer %s' % test_layer)
52 result = runCmd('bitbake-layers show-layers') 52 result = runCmd('bitbake-layers show-layers')
53 self.assertIn('meta-skeleton', result.output) 53 self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
54 result = runCmd('bitbake-layers remove-layer %s' % test_layer) 54 result = runCmd('bitbake-layers remove-layer %s' % test_layer)
55 result = runCmd('bitbake-layers show-layers') 55 result = runCmd('bitbake-layers show-layers')
56 self.assertNotIn('meta-skeleton', result.output) 56 self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output)
57 result = runCmd('bitbake-layers add-layer %s' % test_layer) 57 result = runCmd('bitbake-layers add-layer %s' % test_layer)
58 result = runCmd('bitbake-layers show-layers') 58 result = runCmd('bitbake-layers show-layers')
59 self.assertIn('meta-skeleton', result.output) 59 self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
60 result = runCmd('bitbake-layers remove-layer */meta-skeleton') 60 result = runCmd('bitbake-layers remove-layer */meta-skeleton')
61 result = runCmd('bitbake-layers show-layers') 61 result = runCmd('bitbake-layers show-layers')
62 self.assertNotIn('meta-skeleton', result.output) 62 self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output)