summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py23
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 00d1b64469..651d575dc3 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
1038 newdirs = set(line.split()[-1] for line in result.output.split('\n') if line) 1038 newdirs = set(line.split()[-1] for line in result.output.split('\n') if line)
1039 self.assertEqual(newdirs.difference(dirs), set([os.path.basename(testfile.name)])) 1039 self.assertEqual(newdirs.difference(dirs), set([os.path.basename(testfile.name)]))
1040 1040
1041 def test_wic_rm_ext(self):
1042 """Test removing files from the ext partition."""
1043 self.assertEqual(0, runCmd("wic create mkefidisk "
1044 "--image-name=core-image-minimal "
1045 "-D -o %s" % self.resultdir).status)
1046 images = glob(self.resultdir + "mkefidisk-*.direct")
1047 self.assertEqual(1, len(images))
1048
1049 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
1050
1051 # list directory content of the /etc directory on ext4 partition
1052 result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
1053 self.assertEqual(0, result.status)
1054 self.assertTrue('fstab' in [line.split()[-1] for line in result.output.split('\n') if line])
1055
1056 # remove file
1057 result = runCmd("wic rm %s:2/etc/fstab -n %s" % (images[0], sysroot))
1058 self.assertEqual(0, result.status)
1059
1060 # check if it's removed
1061 result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
1062 self.assertEqual(0, result.status)
1063 self.assertTrue('fstab' not in [line.split()[-1] for line in result.output.split('\n') if line])