diff options
author | Corneliu Stoicescu <corneliux.stoicescu@intel.com> | 2014-02-27 15:53:16 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-28 14:01:13 +0000 |
commit | a18cd65908ec3d50a0d861fa29c12d7776f921d0 (patch) | |
tree | de60c18a6d0b7586bbe972c66e74d2822913e8bb | |
parent | 6a606f9088ec825ba4e3f943f5471a954ba12070 (diff) | |
download | poky-a18cd65908ec3d50a0d861fa29c12d7776f921d0.tar.gz |
oe-selftest: Fix for test_rm_old_image
After recent changes in poky this test was not working as it should.
This commit fixes and improves the test logic.
(From OE-Core rev: 45709d1eae28fc567c5dca9a48393d56d28f785d)
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/buildoptions.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py index ef6579b335..93b02cf8a2 100644 --- a/meta/lib/oeqa/selftest/buildoptions.py +++ b/meta/lib/oeqa/selftest/buildoptions.py | |||
@@ -26,10 +26,16 @@ class ImageOptionsTests(oeSelfTest): | |||
26 | bitbake("core-image-minimal") | 26 | bitbake("core-image-minimal") |
27 | deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal") | 27 | deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal") |
28 | imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal") | 28 | imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal") |
29 | oldimgpath = os.path.realpath(os.path.join(deploydir, imagename + ".ext3")) | 29 | deploydir_files = os.listdir(deploydir) |
30 | track_original_files = [] | ||
31 | for image_file in deploydir_files: | ||
32 | if imagename in image_file and os.path.islink(os.path.join(deploydir, image_file)): | ||
33 | track_original_files.append(os.path.realpath(os.path.join(deploydir, image_file))) | ||
30 | self.append_config("RM_OLD_IMAGE = \"1\"") | 34 | self.append_config("RM_OLD_IMAGE = \"1\"") |
31 | bitbake("core-image-minimal") | 35 | bitbake("-C rootfs core-image-minimal") |
32 | self.assertFalse(os.path.exists(oldimgpath), msg="Old image path still exists: %s" % oldimgpath) | 36 | deploydir_files = os.listdir(deploydir) |
37 | remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files] | ||
38 | self.assertFalse(remaining_not_expected, msg="\nThe following image files ware not removed: %s" % ', '.join(map(str, remaining_not_expected))) | ||
33 | 39 | ||
34 | def test_ccache_tool(self): | 40 | def test_ccache_tool(self): |
35 | bitbake("ccache-native") | 41 | bitbake("ccache-native") |