summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-09-05 14:54:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-11 17:30:29 +0100
commitd3739ff0e26c45f59c0bc6a408269dc848d632dd (patch)
tree617e9637861f3d1123f048d787a8471ef2cbf446 /meta/lib
parent387adfb09e291e4612de4db8be634b432170c85a (diff)
downloadpoky-d3739ff0e26c45f59c0bc6a408269dc848d632dd.tar.gz
wic: selftest: add test_wic_ls_ext test case
Tested if 'wic ls' correctly lists directory contents of the ext* partition. (From OE-Core rev: 6ae3ff957b5c28c7853966cd5a7665772c594546) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index fc19a3f211..eaec37dd14 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -992,3 +992,19 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
992 os.unlink(new_image_path) 992 os.unlink(new_image_path)
993 if os.path.exists(image_path + '.bak'): 993 if os.path.exists(image_path + '.bak'):
994 os.rename(image_path + '.bak', image_path) 994 os.rename(image_path + '.bak', image_path)
995
996 def test_wic_ls_ext(self):
997 """Test listing content of the ext partition using 'wic ls'"""
998 self.assertEqual(0, runCmd("wic create wictestdisk "
999 "--image-name=core-image-minimal "
1000 "-D -o %s" % self.resultdir).status)
1001 images = glob(self.resultdir + "wictestdisk-*.direct")
1002 self.assertEqual(1, len(images))
1003
1004 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
1005
1006 # list directory content of the second ext4 partition
1007 result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
1008 self.assertEqual(0, result.status)
1009 self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(
1010 set(line.split()[-1] for line in result.output.split('\n') if line)))