summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-03-16 10:45:29 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-20 10:59:03 +0000
commitc4ae1e2c98bee62fcc8db4849b6a4f9a5996a210 (patch)
tree8f14c1203da70f396c56325cb03af1d4d5682473 /meta/lib
parent1666b41e73f2aa7bd736c3e9bf3797946bff61b5 (diff)
downloadopenembedded-core-c4ae1e2c98bee62fcc8db4849b6a4f9a5996a210.tar.gz
openembedded-core-c4ae1e2c98bee62fcc8db4849b6a4f9a5996a210.tar.bz2
openembedded-core-c4ae1e2c98bee62fcc8db4849b6a4f9a5996a210.zip
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() Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib')
-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):
@testcase(90)
def test_bitbakelayers_showoverlayed(self):
result = runCmd('bitbake-layers show-overlayed')
- self.assertTrue('aspell' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised')
+ self.assertTrue('aspell' in result.output, msg='aspell overlayed recipe was not recognised')
@testcase(95)
def test_bitbakelayers_flatten(self):
- self.assertFalse(os.path.isdir(os.path.join(self.builddir, 'test')))
- result = runCmd('bitbake-layers flatten test')
- bb_file = os.path.join(self.builddir, 'test/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
+ testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten')
+ self.assertFalse(os.path.isdir(testoutdir))
+ self.track_for_cleanup(testoutdir)
+ result = runCmd('bitbake-layers flatten %s' % testoutdir)
+ bb_file = os.path.join(testoutdir, 'recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
self.assertTrue(os.path.isfile(bb_file))
contents = ftools.read_file(bb_file)
find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
- shutil.rmtree(os.path.join(self.builddir, 'test'))
self.assertTrue(find_in_contents)
+
+ def test_bitbakelayers_add_remove(self):
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output, 'This test cannot run with meta-skeleton in bblayers.conf')
+ result = runCmd('bitbake-layers add-layer ../meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn('meta-skeleton', result.output)
+ result = runCmd('bitbake-layers remove-layer ../meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output)
+ result = runCmd('bitbake-layers add-layer ../meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn('meta-skeleton', result.output)
+ result = runCmd('bitbake-layers remove-layer */meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output)