]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/wic: test wic rm with -r flag
authorChee Yang Lee <chee.yang.lee@intel.com>
Fri, 15 Nov 2019 01:58:47 +0000 (09:58 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 21 Nov 2019 21:17:40 +0000 (21:17 +0000)
selftest to make sure wic rm with -r flag for ext partition
could remove directory and all its content.

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/wic.py

index ea75300406e045261b5de7ff058003e706b1ffd5..0c03b4b02d07edf2fd4e0aadd33c8397c268ac38 100644 (file)
@@ -1025,3 +1025,10 @@ class Wic2(WicTestCase):
         # check if it's removed
         result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
         self.assertTrue('fstab' not in [line.split()[-1] for line in result.output.split('\n') if line])
+
+        # remove non-empty directory
+        runCmd("wic rm -r %s:2/etc/ -n %s" % (images[0], sysroot))
+
+        # check if it's removed
+        result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+        self.assertTrue('etc' not in [line.split()[-1] for line in result.output.split('\n') if line])