]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
wic: add test for partition hidden attributes
authorLee Chee Yang <chee.yang.lee@intel.com>
Wed, 22 Nov 2023 10:01:31 +0000 (18:01 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Nov 2023 22:54:31 +0000 (22:54 +0000)
Add test for the --hidden argument introduced in Oe-Core
rev 7a111ff58d7390b79e2e63c8059f6c25f40f8977.

Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/wic.py

index b4866bcb323b575bffe4baf8ca71e6a4139ac1f3..ab248c58983a2623563a690ddaa3998831f4ee66 100644 (file)
@@ -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):