From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 6/6] selftest: add test_wic_rm test case
Date: Wed, 7 Jun 2017 13:25:30 +0300 [thread overview]
Message-ID: <e4d6b5417020f4f3ec656b7fc49f65e4cba7c455.1496830884.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1496830884.git.ed.bartosh@linux.intel.com>
Added test case for "wic rm" functionality.
- remove file from vfat partition
- remove directory from vfat partition
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
meta/lib/oeqa/selftest/cases/wic.py | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index fa1a71c957..0e58a40ffc 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -891,3 +891,33 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
self.assertEqual(0, result.status)
self.assertEqual(8, len(result.output.split('\n')))
self.assertTrue(os.path.basename(testdir) in result.output)
+
+ def test_wic_rm(self):
+ """Test removing files and directories from the the wic image."""
+ 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 first partition
+ result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue('\nbzimage ' in result.output)
+ self.assertTrue('\nefi <DIR> ' in result.output)
+
+ # remove file
+ result = runCmd("wic rm %s:1/bzimage -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # remove directory
+ result = runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if they're removed
+ result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertFalse('\nbzimage ' in result.output)
+ self.assertFalse('\nefi <DIR> ' in result.output)
--
2.12.0
next prev parent reply other threads:[~2017-06-07 10:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 10:25 [PATCH v2 0/6] #11283: wic rm Ed Bartosh
2017-06-07 10:25 ` [PATCH v2 1/6] wic: add wic_init_parser_rm Ed Bartosh
2017-06-07 10:25 ` [PATCH v2 2/6] wic: add help and usage content for 'wic rm' Ed Bartosh
2017-06-07 10:25 ` [PATCH v2 3/6] wic: add 'wic rm' command Ed Bartosh
2017-06-07 10:25 ` [PATCH v2 4/6] wic: implement removing files Ed Bartosh
2017-06-07 10:25 ` [PATCH v2 5/6] wic: implement removing directories Ed Bartosh
2017-06-07 10:25 ` Ed Bartosh [this message]
2017-06-07 10:31 ` ✗ patchtest: failure for #11283: wic rm (rev2) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4d6b5417020f4f3ec656b7fc49f65e4cba7c455.1496830884.git.ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox