summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
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)