summaryrefslogtreecommitdiffstats
path: root/src/tests/settings_test.c
diff options
context:
space:
mode:
authorMichael Brown2013-11-14 13:34:35 +0100
committerMichael Brown2013-11-14 13:35:43 +0100
commitc1570d3dfb24c08377cc6cf5a335892e39bd9bd2 (patch)
treec3f25ae6bc637d431e4e5fb76459331ee36f2c13 /src/tests/settings_test.c
parent[ipv6] Use given source address only if it is not the unspecified address (diff)
downloadipxe-c1570d3dfb24c08377cc6cf5a335892e39bd9bd2.tar.gz
ipxe-c1570d3dfb24c08377cc6cf5a335892e39bd9bd2.tar.xz
ipxe-c1570d3dfb24c08377cc6cf5a335892e39bd9bd2.zip
[ipv6] Add "ipv6" setting type
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests/settings_test.c')
-rw-r--r--src/tests/settings_test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/settings_test.c b/src/tests/settings_test.c
index d1d923a4..1be2cc32 100644
--- a/src/tests/settings_test.c
+++ b/src/tests/settings_test.c
@@ -173,6 +173,12 @@ static struct setting test_ipv4_setting = {
.type = &setting_type_ipv4,
};
+/** Test IPv6 address setting type */
+static struct setting test_ipv6_setting = {
+ .name = "test_ipv6",
+ .type = &setting_type_ipv6,
+};
+
/** Test signed 8-bit integer setting type */
static struct setting test_int8_setting = {
.name = "test_int8",
@@ -267,6 +273,16 @@ static void settings_test_exec ( void ) {
fetchf_ok ( &test_settings, &test_ipv4_setting,
RAW ( 212, 13, 204, 60 ), "212.13.204.60" );
+ /* "ipv6" setting type */
+ storef_ok ( &test_settings, &test_ipv6_setting,
+ "2001:ba8:0:1d4::6950:5845",
+ RAW ( 0x20, 0x01, 0x0b, 0xa8, 0x00, 0x00, 0x01, 0xd4,
+ 0x00, 0x00, 0x00, 0x00, 0x69, 0x50, 0x58, 0x45 ) );
+ fetchf_ok ( &test_settings, &test_ipv6_setting,
+ RAW ( 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x0c, 0x29, 0xff, 0xfe, 0xc5, 0x39, 0xa1 ),
+ "fe80::20c:29ff:fec5:39a1" );
+
/* Integer setting types (as formatted strings) */
storef_ok ( &test_settings, &test_int8_setting,
"54", RAW ( 54 ) );