From db27d8fbb44d2cdd524ac992630c781fd0c45b1b Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Mon, 2 May 2016 15:22:34 +0300 Subject: selftest: add bmap test Added test_bmap to imagefeatures tests. It tests if bmap file is generated for the images and if the image is sparse. [YOCTO #9414] Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/imagefeatures.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/imagefeatures.py index 8a53899c7d..08e382f2b7 100644 --- a/meta/lib/oeqa/selftest/imagefeatures.py +++ b/meta/lib/oeqa/selftest/imagefeatures.py @@ -98,3 +98,30 @@ class ImageFeatures(oeSelfTest): # Build a core-image-weston bitbake('core-image-weston') + def test_bmap(self): + """ + Summary: Check bmap support + Expected: 1. core-image-minimal can be build with bmap support + 2. core-image-minimal is sparse + Product: oe-core + Author: Ed Bartosh + """ + + features = 'IMAGE_FSTYPES += " ext4 ext4.bmap"' + self.write_config(features) + + image_name = 'core-image-minimal' + bitbake(image_name) + + deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') + link_name = get_bb_var('IMAGE_LINK_NAME', image_name) + image_path = os.path.join(deploy_dir, "%s.ext4" % link_name) + bmap_path = "%s.bmap" % image_path + + # check if result image and bmap file are in deploy directory + self.assertTrue(os.path.exists(image_path)) + self.assertTrue(os.path.exists(bmap_path)) + + # check if result image is sparse + image_stat = os.stat(image_path) + self.assertTrue(image_stat.st_size > image_stat.st_blocks * 512) -- cgit 1.2.3-korg