summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-06-17 17:21:42 -0600
committerTom Rini <trini@konsulko.com>2025-06-17 17:21:42 -0600
commita239cdc0bd4bfe5fce82368627fc55a5fa632e3a (patch)
tree63e5ea3edadceb886359213ece983f096fb6785a /test/py
parent17012e3068d047ad71460f039eeb0c3be63f82a0 (diff)
parent7a598e633a5376ddae6a96bfcdb28c8e7b422b0c (diff)
Merge patch series "Restore support of short name for type UUID parameter"
Patrick Delaunay <patrick.delaunay@foss.st.com> says: Fix and add documentation/tests for selection by string for known partition type GUID introduced by bcb41dcaefac ("uuid: add selection by string for known partition type GUID"): - split list_guid for short name (used also for partiton description with type parameter) and full name to display information - as the function are uuid_str_to_bin() / uuid_guid_get_str() are no more under CONFIG_PARTITION_TYPE_GUID, since commit 31ce367cd100 ("lib/uuid.c: change prototype of uuid_guid_get_str()") and commit c1528f324c60 ("lib: compile uuid_guid_get_str if CONFIG_LIB_UUID=y") move the content of array under EFI_PARTITION and linker will remove it is not used it (in SPL) - Add and fix documentation for gpt command - Add test test_gpt_write_part_type to test "type=" parameters This first patch solves an issue for the "system" shortcut for ESP, removed by commit d54V3 version solve issue for "ESP" support when CONFIG_CMD_EFIDEBUG and CONFIG_EFI is not activated for example for test with qemu-arm-sbsa defconfige1004b8b1 ("lib/uuid.c: use unique name for PARTITION_SYSTEM_GUID") but used in 2 location (at least): 1- board/samsung/e850-96/e850-96.env:10: partitions=name=esp,start=512K,size=128M,bootable,type=system; partitions+=name=rootfs,size=-,bootable,type=linux 2- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c:1151 case PART_ESP: /* EFI System Partition */ 459219 type_str = "system" .... offset += snprintf(buf + offset, buflen - offset, ",type=%s", type_str); CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/26699 Link: https://lore.kernel.org/r/20250616112749.17311-1-patrick.delaunay@foss.st.com
Diffstat (limited to 'test/py')
-rw-r--r--test/py/tests/test_gpt.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/py/tests/test_gpt.py b/test/py/tests/test_gpt.py
index cfc8f1319a9..e6d8792ac1f 100644
--- a/test/py/tests/test_gpt.py
+++ b/test/py/tests/test_gpt.py
@@ -330,6 +330,33 @@ def test_gpt_write(state_disk_image, ubman):
output = ubman.run_command('gpt guid host 0')
assert '375a56f7-d6c9-4e81-b5f0-09d41ca89efe' in output
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.buildconfigspec('cmd_gpt')
+@pytest.mark.buildconfigspec('cmd_part')
+@pytest.mark.buildconfigspec('partition_type_guid')
+@pytest.mark.requiredtool('sgdisk')
+def test_gpt_write_part_type(state_disk_image, ubman):
+ """Test the gpt command with part type uuid."""
+
+ output = ubman.run_command('gpt write host 0 "name=part1,type=data,size=1M;name=part2,size=512K,type=system;name=part3,size=65536,type=u-boot-env;name=part4,size=65536,type=375a56f7-d6c9-4e81-b5f0-09d41ca89efe;name=part5,size=-,type=linux"')
+ assert 'Writing GPT: success!' in output
+ output = ubman.run_command('part list host 0')
+ assert '1\t0x00000022\t0x00000821\t"part1"' in output
+ assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output
+ assert '(data)' in output
+ assert '2\t0x00000822\t0x00000c21\t"part2"' in output
+ assert 'c12a7328-f81f-11d2-ba4b-00a0c93ec93b' in output
+ assert '(EFI System Partition)' in output
+ assert '3\t0x00000c22\t0x00000ca1\t"part3"' in output
+ assert '3de21764-95bd-54bd-a5c3-4abe786f38a8' in output
+ assert '(u-boot-env)' in output
+ assert '4\t0x00000ca2\t0x00000d21\t"part4"' in output
+ assert 'ebd0a0a2-b9e5-4433-87c0-68b6b72699c7' in output
+ assert '(375a56f7-d6c9-4e81-b5f0-09d41ca89efe)' in output
+ assert '5\t0x00000d22\t0x00001fde\t"part5"' in output
+ assert '0fc63daf-8483-4772-8e79-3d69d8477de4' in output
+ assert '(linux)' in output
+
@pytest.mark.buildconfigspec('cmd_gpt')
@pytest.mark.buildconfigspec('cmd_gpt_rename')
@pytest.mark.buildconfigspec('cmd_part')