diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-09-22 17:21:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-23 09:53:19 +0100 |
commit | 76084cdfa6b303f60d10484b84252c7b1560a0ec (patch) | |
tree | 14d8dbde5b6e8f230d6ae5977ebde9637e2b7b50 /meta/lib | |
parent | ef197f9b998c6e54f21af8729dcd953fbd6c7e40 (diff) | |
download | poky-76084cdfa6b303f60d10484b84252c7b1560a0ec.tar.gz |
devtool: build-image: delete bbappend at end of build
Upon further reflection, it seems to me that this bbappend ought to just
be deleted at the end of the build. This keeps things simple; you never
have to remember to delete any files to get back to where you were
before with the image. This means we can also drop the slightly awkward
message reminding the user how to do that. I've also updated the test to
look at the image manifest to determine if the command has worked
instead of looking for the (now deleted) bbappend.
(From OE-Core rev: f6b90bceaedf9bad3d111e6ca1fa79e59f472c73)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 6e731d6777..3a8168c2d5 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
@@ -919,7 +919,8 @@ class DevtoolTests(DevtoolBase): | |||
919 | self.add_command_to_tearDown('bitbake -c clean %s' % image) | 919 | self.add_command_to_tearDown('bitbake -c clean %s' % image) |
920 | bitbake('%s -c clean' % image) | 920 | bitbake('%s -c clean' % image) |
921 | # Add target and native recipes to workspace | 921 | # Add target and native recipes to workspace |
922 | for recipe in ('mdadm', 'parted-native'): | 922 | recipes = ['mdadm', 'parted-native'] |
923 | for recipe in recipes: | ||
923 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | 924 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') |
924 | self.track_for_cleanup(tempdir) | 925 | self.track_for_cleanup(tempdir) |
925 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe) | 926 | self.add_command_to_tearDown('bitbake -c clean %s' % recipe) |
@@ -927,12 +928,19 @@ class DevtoolTests(DevtoolBase): | |||
927 | # Try to build image | 928 | # Try to build image |
928 | result = runCmd('devtool build-image %s' % image) | 929 | result = runCmd('devtool build-image %s' % image) |
929 | self.assertNotEqual(result, 0, 'devtool build-image failed') | 930 | self.assertNotEqual(result, 0, 'devtool build-image failed') |
930 | # Check if image.bbappend has required content | 931 | # Check if image contains expected packages |
931 | bbappend = os.path.join(workspacedir, 'appends', image+'.bbappend') | 932 | deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE') |
932 | self.assertTrue(os.path.isfile(bbappend), 'bbappend not created %s' % result.output) | 933 | image_link_name = get_bb_var('IMAGE_LINK_NAME', image) |
933 | # NOTE: native recipe parted-native should not be in IMAGE_INSTALL_append | 934 | reqpkgs = [item for item in recipes if not item.endswith('-native')] |
934 | self.assertTrue('IMAGE_INSTALL_append = " mdadm"\n' in open(bbappend).readlines(), | 935 | with open(os.path.join(deploy_dir_image, image_link_name + '.manifest'), 'r') as f: |
935 | 'IMAGE_INSTALL_append = " mdadm" not found in %s' % bbappend) | 936 | for line in f: |
937 | splitval = line.split() | ||
938 | if splitval: | ||
939 | pkg = splitval[0] | ||
940 | if pkg in reqpkgs: | ||
941 | reqpkgs.remove(pkg) | ||
942 | if reqpkgs: | ||
943 | self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs)) | ||
936 | 944 | ||
937 | def test_devtool_upgrade(self): | 945 | def test_devtool_upgrade(self): |
938 | # Check preconditions | 946 | # Check preconditions |