summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-13 14:22:14 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 10:18:30 +0100
commit1de1a34a64d2e34d438f6d24adbd70a62366dab7 (patch)
tree64f44f9a497c77df095fd4276b8218b4bd687c92 /meta
parent6a8f4426b071ab97c89f36cc133cc48b4c671e56 (diff)
downloadpoky-1de1a34a64d2e34d438f6d24adbd70a62366dab7.tar.gz
selftest: add test_wic_rm test case
Added test case for "wic rm" functionality. - remove file from vfat partition - remove directory from vfat partition (From OE-Core rev: fc42914d426ad2dad8c3026668726c003b3ab10b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 5034587429..ee9ff0f2dd 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -855,3 +855,33 @@ part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --r
855 self.assertEqual(0, result.status) 855 self.assertEqual(0, result.status)
856 self.assertEqual(8, len(result.output.split('\n'))) 856 self.assertEqual(8, len(result.output.split('\n')))
857 self.assertTrue(os.path.basename(testdir) in result.output) 857 self.assertTrue(os.path.basename(testdir) in result.output)
858
859 def test_wic_rm(self):
860 """Test removing files and directories from the the wic image."""
861 self.assertEqual(0, runCmd("wic create mkefidisk "
862 "--image-name=core-image-minimal "
863 "-D -o %s" % self.resultdir).status)
864 images = glob(self.resultdir + "mkefidisk-*.direct")
865 self.assertEqual(1, len(images))
866
867 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
868
869 # list directory content of the first partition
870 result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
871 self.assertEqual(0, result.status)
872 self.assertIn('\nBZIMAGE ', result.output)
873 self.assertIn('\nEFI <DIR> ', result.output)
874
875 # remove file
876 result = runCmd("wic rm %s:1/bzimage -n %s" % (images[0], sysroot))
877 self.assertEqual(0, result.status)
878
879 # remove directory
880 result = runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
881 self.assertEqual(0, result.status)
882
883 # check if they're removed
884 result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
885 self.assertEqual(0, result.status)
886 self.assertNotIn('\nBZIMAGE ', result.output)
887 self.assertNotIn('\nEFI <DIR> ', result.output)