summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-13 14:21:57 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:29 +0100
commit491779839573105287634ccf7ff261a89fc904f8 (patch)
tree2ff8098d7d5e00650492267f794b82a4d6fe07f3
parent6f1b89c224f0ea4ecf45cf0ef7a8927c5c88d763 (diff)
downloadpoky-491779839573105287634ccf7ff261a89fc904f8.tar.gz
selftest: add new test case test_wic_ls
Tested 'wic ls' functionality: - list of image partitions - list of directory content of vfat partition (From OE-Core rev: 3b271f6a40d7ef93fff9700dd8ac98bddd92d581) 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/cases/wic.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 4040cf7246..5d67395889 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
791 # 8 blocks is 4K (physical sector size) 791 # 8 blocks is 4K (physical sector size)
792 self.assertEqual(dest_stat.st_blocks, 8) 792 self.assertEqual(dest_stat.st_blocks, 8)
793 os.unlink(dest) 793 os.unlink(dest)
794
795 def test_wic_ls(self):
796 """Test listing image content using 'wic ls'"""
797 self.assertEqual(0, runCmd("wic create wictestdisk "
798 "--image-name=core-image-minimal "
799 "-D -o %s" % self.resultdir).status)
800 images = glob(self.resultdir + "wictestdisk-*.direct")
801 self.assertEqual(1, len(images))
802
803 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
804
805 # list partitions
806 result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
807 self.assertEqual(0, result.status)
808 self.assertEqual(3, len(result.output.split('\n')))
809
810 # list directory content of the first partition
811 result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
812 self.assertEqual(0, result.status)
813 self.assertEqual(6, len(result.output.split('\n')))