summaryrefslogtreecommitdiff
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-08-30 15:19:27 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-31 11:37:00 +0100
commit524c590fb44d0ef9711accf2db1a21e4a3cbcfc2 (patch)
treed7daa3811e6c70137e7b7eed45f67cd6d58081f3 /meta/lib/oeqa/selftest
parent72dfe5b58c637d74971e025aef3ce0a64dc8172c (diff)
downloadopenembedded-core-524c590fb44d0ef9711accf2db1a21e4a3cbcfc2.tar.gz
openembedded-core-524c590fb44d0ef9711accf2db1a21e4a3cbcfc2.tar.bz2
openembedded-core-524c590fb44d0ef9711accf2db1a21e4a3cbcfc2.zip
oe-selftest: test devtool build-image plugin
Added test case to test functionaly of build-image plugin: Add two packages to workspace and run 'devtool build-image core-image-minimal'. Checked if command is successful. Checked if expected package is added to generated core-image-minimal.bbappend file. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 70ee634c71..a6474b7979 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -887,3 +887,29 @@ class DevtoolTests(DevtoolBase):
result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip))
result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
+
+ def test_devtool_build_image(self):
+ """Test devtool build-image plugin"""
+ # Check preconditions
+ workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ image = 'core-image-minimal'
+ self.track_for_cleanup(workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % image)
+ bitbake('%s -c clean' % image)
+ # Add target and native recipes to workspace
+ for recipe in ('mdadm', 'parted-native'):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
+ runCmd('devtool modify %s -x %s' % (recipe, tempdir))
+ # Try to build image
+ result = runCmd('devtool build-image %s' % image)
+ self.assertNotEqual(result, 0, 'devtool build-image failed')
+ # Check if image.bbappend has required content
+ bbappend = os.path.join(workspacedir, 'appends', image+'.bbappend')
+ self.assertTrue(os.path.isfile(bbappend), 'bbappend not created %s' % result.output)
+ # NOTE: native recipe parted-native should not be in IMAGE_INSTALL_append
+ self.assertTrue('IMAGE_INSTALL_append = " mdadm"\n' in open(bbappend).readlines(),
+ 'IMAGE_INSTALL_append = " mdadm" not found in %s' % bbappend)