diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2016-03-10 10:29:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-11 16:50:44 +0000 |
commit | a5fd57d971e91c1278bdf0b4b95893cea240980b (patch) | |
tree | 08aebd44ac38377a97b470c3463e455c0e0b7dc6 /meta/lib | |
parent | dce7290a4f57cf7a7bc1568eecc43bfa49ea8e76 (diff) | |
download | poky-a5fd57d971e91c1278bdf0b4b95893cea240980b.tar.gz |
selftest/bblayers.py: Remove harcoded recipe files
Currently the recipe files are hardcoded and if the recipe
change the version, the test will fail.
This will change from using a harcoded file to look for the
file using bitbake-layers. Now, just the recipe name must
be specified.
(From OE-Core rev: 1ee24e435353d93374895eead81fb281e1338739)
Signed-off-by: Mariano Lopez <mariano.lopez@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/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/bblayers.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py index b88c25ecfb..d23675e84a 100644 --- a/meta/lib/oeqa/selftest/bblayers.py +++ b/meta/lib/oeqa/selftest/bblayers.py | |||
@@ -23,8 +23,10 @@ class BitbakeLayers(oeSelfTest): | |||
23 | 23 | ||
24 | @testcase(93) | 24 | @testcase(93) |
25 | def test_bitbakelayers_showappends(self): | 25 | def test_bitbakelayers_showappends(self): |
26 | recipe = "xcursor-transparent-theme" | ||
27 | bb_file = self.get_recipe_basename(recipe) | ||
26 | result = runCmd('bitbake-layers show-appends') | 28 | 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. bitbake-layers show-appends output: %s" % result.output) | 29 | self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output)) |
28 | 30 | ||
29 | @testcase(90) | 31 | @testcase(90) |
30 | def test_bitbakelayers_showoverlayed(self): | 32 | def test_bitbakelayers_showoverlayed(self): |
@@ -33,11 +35,14 @@ class BitbakeLayers(oeSelfTest): | |||
33 | 35 | ||
34 | @testcase(95) | 36 | @testcase(95) |
35 | def test_bitbakelayers_flatten(self): | 37 | def test_bitbakelayers_flatten(self): |
38 | recipe = "xcursor-transparent-theme" | ||
39 | recipe_path = "recipes-graphics/xcursor-transparent-theme" | ||
40 | recipe_file = self.get_recipe_basename(recipe) | ||
36 | testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten') | 41 | testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten') |
37 | self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time") | 42 | self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time") |
38 | self.track_for_cleanup(testoutdir) | 43 | self.track_for_cleanup(testoutdir) |
39 | result = runCmd('bitbake-layers flatten %s' % testoutdir) | 44 | 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') | 45 | bb_file = os.path.join(testoutdir, recipe_path, recipe_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.") | 46 | 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) | 47 | contents = ftools.read_file(bb_file) |
43 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) | 48 | find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents) |
@@ -86,3 +91,14 @@ class BitbakeLayers(oeSelfTest): | |||
86 | result = runCmd('bitbake-layers show-recipes -i nonexistentclass', ignore_status=True) | 91 | result = runCmd('bitbake-layers show-recipes -i nonexistentclass', ignore_status=True) |
87 | self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') | 92 | self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed') |
88 | self.assertIn('ERROR:', result.output) | 93 | self.assertIn('ERROR:', result.output) |
94 | |||
95 | def get_recipe_basename(self, recipe): | ||
96 | recipe_file = "" | ||
97 | result = runCmd("bitbake-layers show-recipes -f %s" % recipe) | ||
98 | for line in result.output.splitlines(): | ||
99 | if recipe in line: | ||
100 | recipe_file = line | ||
101 | break | ||
102 | |||
103 | self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe) | ||
104 | return os.path.basename(recipe_file) | ||