wic: add test for partition hidden attributes
PATCH 1/1 wic: add test for partition hidden attributes
From: Lee Chee Yang <[email protected]>
Add test for the --hidden argument introduced in Oe-Core rev 7a111ff58d7390b79e2e63c8059f6c25f40f8977.
Signed-off-by Lee Chee Yang <[email protected]>
--- meta/lib/oeqa/selftest/cases/wic.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
meta/lib/oeqa/selftest/cases/wic.py +24 -0
@@ -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):
Signature · 1 line
2.37.3