[PATCH 08/25] selftest: add new test case test_wic_ls

Ed Bartosh
2017-06-08T16:15:19Z

Tested 'wic ls' functionality:
- list of image partitions
- list of directory content of vfat partition

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
meta/lib/oeqa/selftest/cases/wic.py | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 4040cf7..5d67395 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -791,3 +791,23 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
# 8 blocks is 4K (physical sector size)
self.assertEqual(dest_stat.st_blocks, 8)
os.unlink(dest)
+
+ def test_wic_ls(self):
+ """Test listing image content using 'wic ls'"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "wictestdisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list partitions
+ result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(3, len(result.output.split('\n')))
+
+ # list directory content of the first partition
+ result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(6, len(result.output.split('\n')))
--
2.1.4