summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-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)