summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <eballetb@redhat.com>2023-01-10 19:19:35 +0300
committerTom Rini <trini@konsulko.com>2023-01-18 21:11:13 +0300
commit601d1bfe9e313938e24a83f64d2d45aa62a16abd (patch)
tree8eeb7f7a90a45553a15f295701d90f4a736fe8b3 /test
parent22e7f1d108410cc81a0ec5a6481338e4d6e9586e (diff)
downloadu-boot-601d1bfe9e313938e24a83f64d2d45aa62a16abd.tar.xz
test/py: gpt: add test for the gpt partition type GUID identifier
Add sandbox test for the gpt partition type command, the test uses the persistent data test_gpt_disk_image.bin to check that the first partition type GUID that identifies the type of the partition has the "Linux filesystem data" type ( 0FC63DAF-8483-4772-8E79-3D69D8477DE4 ). Signed-off-by: Enric Balletbo i Serra <eballetbo@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_gpt.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py
index cb44e1d789..73bfbf77a2 100644
--- a/test/py/tests/test_gpt.py
+++ b/test/py/tests/test_gpt.py
@@ -136,6 +136,29 @@ def test_gpt_save_guid(state_disk_image, u_boot_console):
@pytest.mark.boardspec('sandbox')
@pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.requiredtool('sgdisk')
+def test_gpt_part_type_uuid(state_disk_image, u_boot_console):
+ """Test the gpt partittion type UUID command."""
+
+ u_boot_console.run_command('host bind 0 ' + state_disk_image.path)
+ output = u_boot_console.run_command('part type host 0:1')
+ assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output
+
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.requiredtool('sgdisk')
+def test_gpt_part_type_save_uuid(state_disk_image, u_boot_console):
+ """Test the gpt partittion type to save UUID into a string."""
+
+ if u_boot_console.config.buildconfig.get('config_cmd_gpt', 'n') != 'y':
+ pytest.skip('gpt command not supported')
+ u_boot_console.run_command('host bind 0 ' + state_disk_image.path)
+ output = u_boot_console.run_command('part type host 0:1 newguid')
+ output = u_boot_console.run_command('printenv newguid')
+ assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output
+
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.buildconfigspec('cmd_gpt')
@pytest.mark.buildconfigspec('cmd_gpt_rename')
@pytest.mark.buildconfigspec('cmd_part')
@pytest.mark.requiredtool('sgdisk')