summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorJoshua Lock <joshua.lock@collabora.co.uk>2016-04-08 10:14:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-09 23:00:45 +0100
commit43150ab7ec63d804e8a998ecee9d00295b8b2bc7 (patch)
tree17231d0bd285c2375c6eefbf388c865d8f30369b /meta/lib/oeqa
parent29bc2f74239bc98a152605c339b8a4fb0a15705b (diff)
downloadpoky-43150ab7ec63d804e8a998ecee9d00295b8b2bc7.tar.gz
oeqa/selftest/wic: add test case for sparse images
Add a testcase to build a directdisk image and check that the used disk size is less than the apparent size, as wic now assembles images as sparse files. (From OE-Core rev: 2b8299eb6b911e64d9a05b86c07b489d15eeaa5e) Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/wic.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
index a569fbf747..dd3207528e 100644
--- a/meta/lib/oeqa/selftest/wic.py
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -276,3 +276,16 @@ class Wic(oeSelfTest):
276 status, output = qemu.run_serial(command) 276 status, output = qemu.run_serial(command)
277 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output)) 277 self.assertEqual(1, status, 'Failed to run command "%s": %s' % (command, output))
278 self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt') 278 self.assertEqual(output, '/dev/root /\r\n/dev/vda3 /mnt')
279
280 def test_sparseness(self):
281 """Test that assembled images are sparse; apparent size > disk usage"""
282 self.assertEqual(0, runCmd("wic create directdisk "
283 "--image-name core-image-minimal").status)
284 images = glob(self.resultdir + "directdisk-*.direct")
285 self.assertEqual(1, len(images))
286
287 imagestat = os.stat(images.pop())
288 # st_blocks is the "number of 512-byte blocks allocated for file"
289 used = imagestat.st_blocks*512
290 apparent = imagestat.st_size
291 self.assertLess(used, apparent)