summaryrefslogtreecommitdiffstats
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 23:05:14 +0100
commitff5d6f8854264914d28b8b0d45c017b17a6ef185 (patch)
tree4ffe554682c7ae0e5eba643f5759fc1ff53e995e
parent39498d0e9043f95c423ca6e9fc18233c8fa59622 (diff)
downloadpoky-ff5d6f8854264914d28b8b0d45c017b17a6ef185.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] (From OE-Core rev: db27d8fbb44d2cdd524ac992630c781fd0c45b1b) 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):
98 # Build a core-image-weston 98 # Build a core-image-weston
99 bitbake('core-image-weston') 99 bitbake('core-image-weston')
100 100
101 def test_bmap(self):
102 """
103 Summary: Check bmap support
104 Expected: 1. core-image-minimal can be build with bmap support
105 2. core-image-minimal is sparse
106 Product: oe-core
107 Author: Ed Bartosh <ed.bartosh@linux.intel.com>
108 """
109
110 features = 'IMAGE_FSTYPES += " ext4 ext4.bmap"'
111 self.write_config(features)
112
113 image_name = 'core-image-minimal'
114 bitbake(image_name)
115
116 deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
117 link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
118 image_path = os.path.join(deploy_dir, "%s.ext4" % link_name)
119 bmap_path = "%s.bmap" % image_path
120
121 # check if result image and bmap file are in deploy directory
122 self.assertTrue(os.path.exists(image_path))
123 self.assertTrue(os.path.exists(bmap_path))
124
125 # check if result image is sparse
126 image_stat = os.stat(image_path)
127 self.assertTrue(image_stat.st_size > image_stat.st_blocks * 512)