summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r--meta/lib/oeqa/selftest/cases/wic.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 4ebcb76cc4..b616759209 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -1483,6 +1483,42 @@ class Wic2(WicTestCase):
1483 result = runCmd("%s/usr/sbin/sfdisk --part-label %s 3" % (sysroot, image_path)) 1483 result = runCmd("%s/usr/sbin/sfdisk --part-label %s 3" % (sysroot, image_path))
1484 self.assertEqual('ext-space', result.output) 1484 self.assertEqual('ext-space', result.output)
1485 1485
1486 def test_empty_zeroize_plugin(self):
1487 img = 'core-image-minimal'
1488 expected_size = [ 1024*1024, # 1M
1489 512*1024, # 512K
1490 2*1024*1024] # 2M
1491 # Check combination of sourceparams
1492 with NamedTemporaryFile("w", suffix=".wks") as wks:
1493 wks.writelines(
1494 ['part empty --source empty --sourceparams="fill" --ondisk sda --fixed-size 1M\n',
1495 'part empty --source empty --sourceparams="size=512K" --ondisk sda --size 1M --align 1024\n',
1496 'part empty --source empty --sourceparams="size=2048k,bs=512K" --ondisk sda --size 4M --align 1024\n'
1497 ])
1498 wks.flush()
1499 cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
1500 runCmd(cmd)
1501 wksname = os.path.splitext(os.path.basename(wks.name))[0]
1502 wicout = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
1503 # Skip the complete image and just look at the single partitions
1504 for idx, value in enumerate(wicout[1:]):
1505 self.logger.info(wicout[idx])
1506 # Check if partitions are actually zeroized
1507 with open(wicout[idx], mode="rb") as fd:
1508 ba = bytearray(fd.read())
1509 for b in ba:
1510 self.assertEqual(b, 0)
1511 self.assertEqual(expected_size[idx], os.path.getsize(wicout[idx]))
1512
1513 # Check inconsistancy check between "fill" and "--size" parameter
1514 with NamedTemporaryFile("w", suffix=".wks") as wks:
1515 wks.writelines(['part empty --source empty --sourceparams="fill" --ondisk sda --size 1M\n'])
1516 wks.flush()
1517 cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
1518 result = runCmd(cmd, ignore_status=True)
1519 self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output)
1520 self.assertNotEqual(0, result.status)
1521
1486class ModifyTests(WicTestCase): 1522class ModifyTests(WicTestCase):
1487 def test_wic_ls(self): 1523 def test_wic_ls(self):
1488 """Test listing image content using 'wic ls'""" 1524 """Test listing image content using 'wic ls'"""