diff options
| author | Lee Chee Yang <chee.yang.lee@intel.com> | 2023-11-22 18:01:31 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-27 22:54:59 +0000 |
| commit | dfedec4b2d26a92a4061016f126b84969fc07a56 (patch) | |
| tree | d4656d9c1e2a104c62904b8cdd08620ba42063ac /meta | |
| parent | 0769ff28dbd9690481a4d21e796a3d4e32050cac (diff) | |
| download | poky-dfedec4b2d26a92a4061016f126b84969fc07a56.tar.gz | |
wic: add test for partition hidden attributes
Add test for the --hidden argument introduced in Oe-Core
rev 7a111ff58d7390b79e2e63c8059f6c25f40f8977.
(From OE-Core rev: 819286cdce6471ca3dd048d3950b943b28e6d222)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b4866bcb32..ab248c5898 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
| @@ -748,6 +748,30 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc | |||
| 748 | 748 | ||
| 749 | os.remove(wks_file) | 749 | os.remove(wks_file) |
| 750 | 750 | ||
| 751 | def test_partition_hidden_attributes(self): | ||
| 752 | """Test --hidden wks option.""" | ||
| 753 | wks_file = 'temp.wks' | ||
| 754 | sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') | ||
| 755 | try: | ||
| 756 | with open(wks_file, 'w') as wks: | ||
| 757 | wks.write(""" | ||
| 758 | part / --source rootfs --fstype=ext4 | ||
| 759 | part / --source rootfs --fstype=ext4 --hidden | ||
| 760 | bootloader --ptable gpt""") | ||
| 761 | |||
| 762 | runCmd("wic create %s -e core-image-minimal -o %s" \ | ||
| 763 | % (wks_file, self.resultdir)) | ||
| 764 | wicout = os.path.join(self.resultdir, "*.direct") | ||
| 765 | |||
| 766 | result = runCmd("%s/usr/sbin/sfdisk --part-attrs %s 1" % (sysroot, wicout)) | ||
| 767 | self.assertEqual('', result.output) | ||
| 768 | result = runCmd("%s/usr/sbin/sfdisk --part-attrs %s 2" % (sysroot, wicout)) | ||
| 769 | self.assertEqual('RequiredPartition', result.output) | ||
| 770 | |||
| 771 | finally: | ||
| 772 | os.remove(wks_file) | ||
| 773 | |||
| 774 | |||
| 751 | class Wic2(WicTestCase): | 775 | class Wic2(WicTestCase): |
| 752 | 776 | ||
| 753 | def test_bmap_short(self): | 777 | def test_bmap_short(self): |
