From 819286cdce6471ca3dd048d3950b943b28e6d222 Mon Sep 17 00:00:00 2001 From: Lee Chee Yang Date: Wed, 22 Nov 2023 18:01:31 +0800 Subject: [PATCH] wic: add test for partition hidden attributes Add test for the --hidden argument introduced in Oe-Core rev 7a111ff58d7390b79e2e63c8059f6c25f40f8977. Signed-off-by: Lee Chee Yang Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/wic.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b4866bcb323..ab248c58983 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 os.remove(wks_file) + def test_partition_hidden_attributes(self): + """Test --hidden wks option.""" + wks_file = 'temp.wks' + sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools') + try: + with open(wks_file, 'w') as wks: + wks.write(""" +part / --source rootfs --fstype=ext4 +part / --source rootfs --fstype=ext4 --hidden +bootloader --ptable gpt""") + + runCmd("wic create %s -e core-image-minimal -o %s" \ + % (wks_file, self.resultdir)) + wicout = os.path.join(self.resultdir, "*.direct") + + result = runCmd("%s/usr/sbin/sfdisk --part-attrs %s 1" % (sysroot, wicout)) + self.assertEqual('', result.output) + result = runCmd("%s/usr/sbin/sfdisk --part-attrs %s 2" % (sysroot, wicout)) + self.assertEqual('RequiredPartition', result.output) + + finally: + os.remove(wks_file) + + class Wic2(WicTestCase): def test_bmap_short(self): -- 2.47.3