mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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. (From OE-Core rev: d0a7383ca3e8ac206c88ac3cc1b8e1f18b439964) 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: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
49164d9cc1
commit
1d3cd3c2a5
@@ -588,6 +588,9 @@ part / --source rootfs --fstype=ext4 --include-path %s --include-path core-imag
|
||||
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")
|
||||
|
||||
@@ -621,6 +624,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:
|
||||
|
||||
Reference in New Issue
Block a user