summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2021-02-04 08:29:44 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-05 08:16:32 +0000
commitc05385c88746b8e969d79b6140f5916c4a8bac86 (patch)
tree25663f4256fa224d13ad7153b5d585afef581539 /meta/lib/oeqa/selftest/cases
parent4b5b18c369d9d8bd4b8e8aab4741302c91b7151b (diff)
downloadpoky-c05385c88746b8e969d79b6140f5916c4a8bac86.tar.gz
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: 551ce73a90757ba43501fe5cf9ac84a7b77de549) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-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 091f0ab47c..03a3ac565c 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -588,6 +588,9 @@ part / --source rootfs --fstype=ext4 --include-path %s --include-path core-imag
588 def test_permissions(self): 588 def test_permissions(self):
589 """Test permissions are respected""" 589 """Test permissions are respected"""
590 590
591 # prepare wicenv and rootfs
592 bitbake('core-image-minimal core-image-minimal-mtdutils -c do_rootfs_wicenv')
593
591 oldpath = os.environ['PATH'] 594 oldpath = os.environ['PATH']
592 os.environ['PATH'] = get_bb_var("PATH", "wic-tools") 595 os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
593 596
@@ -621,6 +624,19 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
621 res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part)) 624 res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
622 self.assertEqual(True, files_own_by_root(res.output)) 625 self.assertEqual(True, files_own_by_root(res.output))
623 626
627 config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "%s"\n' % wks_file
628 self.append_config(config)
629 bitbake('core-image-minimal')
630 tmpdir = os.path.join(get_bb_var('WORKDIR', 'core-image-minimal'),'build-wic')
631
632 # check each partition for permission
633 for part in glob(os.path.join(tmpdir, 'temp-*.direct.p*')):
634 res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % (part))
635 self.assertTrue(files_own_by_root(res.output)
636 ,msg='Files permission incorrect using wks set "%s"' % test)
637
638 # clean config and result directory for next cases
639 self.remove_config(config)
624 rmtree(self.resultdir, ignore_errors=True) 640 rmtree(self.resultdir, ignore_errors=True)
625 641
626 finally: 642 finally: