aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-02 15:22:34 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-14 07:26:43 +0100
commitdb27d8fbb44d2cdd524ac992630c781fd0c45b1b (patch)
treec8e49d40fd3f86d4fb20c32817015fe2517c3365
parentd3495d7b5ac90439691bafc5717a3bf1cf014737 (diff)
downloadopenembedded-core-contrib-db27d8fbb44d2cdd524ac992630c781fd0c45b1b.tar.gz
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 <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/imagefeatures.py27
1 files changed, 27 insertions, 0 deletions
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 <ed.bartosh@linux.intel.com>
+ """
+
+ 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)