summaryrefslogtreecommitdiffstats
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:14 +0100
commit22afc047dd1b8f83e56c4a9862710776c509e3c5 (patch)
tree65b25524d847dffb410e6ff982aadbe9bfcd2d03 /meta/lib/oeqa/selftest
parent15526a859145845100190276809a96146419b304 (diff)
downloadpoky-22afc047dd1b8f83e56c4a9862710776c509e3c5.tar.gz
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. (From OE-Core rev: 524c590fb44d0ef9711accf2db1a21e4a3cbcfc2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.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/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):
887 result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip)) 887 result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip))
888 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True) 888 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
889 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have') 889 self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
890
891 def test_devtool_build_image(self):
892 """Test devtool build-image plugin"""
893 # Check preconditions
894 workspacedir = os.path.join(self.builddir, 'workspace')
895 self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
896 image = 'core-image-minimal'
897 self.track_for_cleanup(workspacedir)
898 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
899 self.add_command_to_tearDown('bitbake -c clean %s' % image)
900 bitbake('%s -c clean' % image)
901 # Add target and native recipes to workspace
902 for recipe in ('mdadm', 'parted-native'):
903 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
904 self.track_for_cleanup(tempdir)
905 self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
906 runCmd('devtool modify %s -x %s' % (recipe, tempdir))
907 # Try to build image
908 result = runCmd('devtool build-image %s' % image)
909 self.assertNotEqual(result, 0, 'devtool build-image failed')
910 # Check if image.bbappend has required content
911 bbappend = os.path.join(workspacedir, 'appends', image+'.bbappend')
912 self.assertTrue(os.path.isfile(bbappend), 'bbappend not created %s' % result.output)
913 # NOTE: native recipe parted-native should not be in IMAGE_INSTALL_append
914 self.assertTrue('IMAGE_INSTALL_append = " mdadm"\n' in open(bbappend).readlines(),
915 'IMAGE_INSTALL_append = " mdadm" not found in %s' % bbappend)