aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-02-29 14:04:47 +0000
committerMichael Brown <mcb30@ipxe.org>2024-02-29 15:20:44 +0000
commit0eb8fbd0bfc9331ecdcd74c9406251e5a6e450af (patch)
treed97117bda5d15127bbb272ef70a007ee14aebc62 /src/tests
parentda7b2662890dfb284786f37237a6c92809eee217 (diff)
downloadipxe-0eb8fbd0bfc9331ecdcd74c9406251e5a6e450af.tar.gz
[settings] Add parsing for UUID and GUID settings types
The ":uuid" and ":guid" settings types are currently format-only: it is possible to format a setting as a UUID (via e.g. "show foo:uuid") but it is not currently possible to parse a string into a UUID setting (via e.g. "set foo:uuid 406343fe-998b-44be-8a28-44ca38cb202b"). Use uuid_aton() to implement parsing of these settings types, and add appropriate test cases for both. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/settings_test.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/tests/settings_test.c b/src/tests/settings_test.c
index 5da7eb008..edd7b9d70 100644
--- a/src/tests/settings_test.c
+++ b/src/tests/settings_test.c
@@ -420,13 +420,21 @@ static void settings_test_exec ( void ) {
RAW ( 0x80, 0x81, 0x82, 0x83, 0x84, 0x00, 0xff ),
"gIGCg4QA/w==" );
- /* "uuid" setting type (no store capability) */
+ /* "uuid" setting type */
+ storef_ok ( &test_settings, &test_uuid_setting,
+ "36d22ed9-b64f-4fdb-941b-a54a0854f991",
+ RAW ( 0x36, 0xd2, 0x2e, 0xd9, 0xb6, 0x4f, 0x4f, 0xdb, 0x94,
+ 0x1b, 0xa5, 0x4a, 0x08, 0x54, 0xf9, 0x91 ) );
+ storef_ok ( &test_settings, &test_guid_setting,
+ "7ad4478f-c270-4601-a245-78598f25a984",
+ RAW ( 0x8f, 0x47, 0xd4, 0x7a, 0x70, 0xc2, 0x01, 0x46, 0xa2,
+ 0x45, 0x78, 0x59, 0x8f, 0x25, 0xa9, 0x84 ) );
fetchf_ok ( &test_settings, &test_uuid_setting,
- RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a,0xa8,
+ RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a, 0xa8,
0x7a, 0x7c, 0xfe, 0x4f, 0xca, 0x4a, 0x57 ),
"1a6a749d-0eda-461a-a87a-7cfe4fca4a57" );
fetchf_ok ( &test_settings, &test_guid_setting,
- RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a,0xa8,
+ RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a, 0xa8,
0x7a, 0x7c, 0xfe, 0x4f, 0xca, 0x4a, 0x57 ),
"9d746a1a-da0e-1a46-a87a-7cfe4fca4a57" );