aboutsummaryrefslogtreecommitdiffstats
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:11 +0100
commit6ae3ff957b5c28c7853966cd5a7665772c594546 (patch)
tree47522224df1c71b0206ceba8121830fd9590934e
parentfcff05d666e55a017f11851aa4aad6c3ba9d4ff0 (diff)
downloadopenembedded-core-contrib-6ae3ff957b5c28c7853966cd5a7665772c594546.tar.gz
openembedded-core-contrib-6ae3ff957b5c28c7853966cd5a7665772c594546.tar.bz2
openembedded-core-contrib-6ae3ff957b5c28c7853966cd5a7665772c594546.zip
wic: selftest: add test_wic_ls_ext test case
Tested if 'wic ls' correctly lists directory contents of the ext* partition. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-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 fc19a3f2111..eaec37dd149 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
os.unlink(new_image_path)
if os.path.exists(image_path + '.bak'):
os.rename(image_path + '.bak', image_path)
+
+ def test_wic_ls_ext(self):
+ """Test listing content of the ext partition 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 directory content of the second ext4 partition
+ result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(
+ set(line.split()[-1] for line in result.output.split('\n') if line)))