diff options
-rw-r--r-- | meta-selftest/wic/test_gpt_partition_name.wks | 7 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/wic.py | 23 |
2 files changed, 30 insertions, 0 deletions
diff --git a/meta-selftest/wic/test_gpt_partition_name.wks b/meta-selftest/wic/test_gpt_partition_name.wks new file mode 100644 index 0000000000..7db6da9aee --- /dev/null +++ b/meta-selftest/wic/test_gpt_partition_name.wks | |||
@@ -0,0 +1,7 @@ | |||
1 | # short-description: image to test part-name in GPT partitions | ||
2 | |||
3 | part --fstype=ext4 --part-name boot-A --label boot --size 1M --align 1024 | ||
4 | part / --source rootfs --fstype=ext4 --part-name root-A --align 1024 | ||
5 | part --fstype=ext4 --label ext-space --size 1M --align 1024 | ||
6 | |||
7 | bootloader --ptable gpt | ||
diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py index b26b649c3a..0b0ca90c1e 100644 --- a/meta/lib/oeqa/selftest/cases/wic.py +++ b/meta/lib/oeqa/selftest/cases/wic.py | |||
@@ -1348,6 +1348,29 @@ class Wic2(WicTestCase): | |||
1348 | if os.path.exists(image_path + '.bak'): | 1348 | if os.path.exists(image_path + '.bak'): |
1349 | os.rename(image_path + '.bak', image_path) | 1349 | os.rename(image_path + '.bak', image_path) |
1350 | 1350 | ||
1351 | def test_gpt_partition_name(self): | ||
1352 | """Test --part-name argument to set partition name in GPT table""" | ||
1353 | config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "test_gpt_partition_name.wks"\n' | ||
1354 | self.append_config(config) | ||
1355 | bitbake('core-image-minimal') | ||
1356 | self.remove_config(config) | ||
1357 | deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE') | ||
1358 | machine = self.td['MACHINE'] | ||
1359 | |||
1360 | image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine) | ||
1361 | # Image is created | ||
1362 | self.assertTrue(os.path.exists(image_path)) | ||
1363 | |||
1364 | # Check the names of the three partitions | ||
1365 | # as listed in test_gpt_partition_name.wks | ||
1366 | result = runCmd("sfdisk --part-label %s 1" % image_path) | ||
1367 | self.assertEqual('boot-A', result.output) | ||
1368 | result = runCmd("sfdisk --part-label %s 2" % image_path) | ||
1369 | self.assertEqual('root-A', result.output) | ||
1370 | # When the --part-name is not defined, the partition name is equal to the --label | ||
1371 | result = runCmd("sfdisk --part-label %s 3" % image_path) | ||
1372 | self.assertEqual('ext-space', result.output) | ||
1373 | |||
1351 | class ModifyTests(WicTestCase): | 1374 | class ModifyTests(WicTestCase): |
1352 | def test_wic_ls(self): | 1375 | def test_wic_ls(self): |
1353 | """Test listing image content using 'wic ls'""" | 1376 | """Test listing image content using 'wic ls'""" |