1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

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]

(From OE-Core rev: db27d8fbb44d2cdd524ac992630c781fd0c45b1b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-05-02 15:22:34 +03:00
committed by Richard Purdie
parent 39498d0e90
commit ff5d6f8854
+27
View File
@@ -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)