[gnome-continuous-yocto/gnomeostree-3.28-rocko: 7615/8267] wic: selftest: add test_wic_rm_ext test case
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 7615/8267] wic: selftest: add test_wic_rm_ext test case
- Date: Sun, 17 Dec 2017 06:29:49 +0000 (UTC)
commit e1d59cbab42af44e33f44b5f3a10e07890d7180a
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Tue Sep 5 14:54:42 2017 +0300
wic: selftest: add test_wic_rm_ext test case
Tested if 'wic rm' correctly removes files from the ext4 partition
of the wic image.
(From OE-Core rev: 693b555e4f419b5d24f9f86c44354866492f8bb0)
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>
meta/lib/oeqa/selftest/cases/wic.py | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 00d1b64..651d575 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -1038,3 +1038,26 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
newdirs = set(line.split()[-1] for line in result.output.split('\n') if line)
self.assertEqual(newdirs.difference(dirs), set([os.path.basename(testfile.name)]))
+ def test_wic_rm_ext(self):
+ """Test removing files from the ext partition."""
+ self.assertEqual(0, runCmd("wic create mkefidisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "mkefidisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the /etc directory on ext4 partition
+ result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue('fstab' in [line.split()[-1] for line in result.output.split('\n') if line])
+
+ # remove file
+ result = runCmd("wic rm %s:2/etc/fstab -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if it's removed
+ result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue('fstab' not in [line.split()[-1] for line in result.output.split('\n') if line])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]