aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2021-02-04 08:29:44 +0800
committerSteve Sakoman <steve@sakoman.com>2021-02-09 06:12:09 -1000
commit9efabaff73090b08233b4fcef22142b9ac0c11aa (patch)
tree625535f5b298bceaa46b3726e7aa879c5021e6a8
parent5a3ce870ff54e73543caba5899aabd6c872691b0 (diff)
downloadopenembedded-core-contrib-9efabaff73090b08233b4fcef22142b9ac0c11aa.tar.gz
openembedded-core-contrib-9efabaff73090b08233b4fcef22142b9ac0c11aa.tar.bz2
openembedded-core-contrib-9efabaff73090b08233b4fcef22142b9ac0c11aa.zip
wic/selftest: test_permissions also test bitbake image
existing test case test_permissions use Wic command as standalone tools to create wic image and check that wic image for permissions. add extra steps to the test case to also check against image build using bitbake do_image_wic. Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 551ce73a90757ba43501fe5cf9ac84a7b77de549) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index d4c0db8bdad..0435aa29c9f 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -516,6 +516,9 @@ part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s"""
def test_permissions(self):
"""Test permissions are respected"""
+ # prepare wicenv and rootfs
+ bitbake('core-image-minimal core-image-minimal-mtdutils -c do_rootfs_wicenv')
+
oldpath = os.environ['PATH']
os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
@@ -549,6 +552,19 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
self.assertEqual(True, files_own_by_root(res.output))
+ config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic')
+
+ # check each partition for permission
+ for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')):
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
+ self.assertTrue(files_own_by_root(res.output)
+ ,msg='Files permission incorrect using wks set "%s"' % test)
+
+ # clean config and result directory for next cases
+ self.remove_config(config)
rmtree(self.resultdir, ignore_errors=True)
finally: