On 2012-06-02 02:13, Karl Auer wrote:
I seem to remember seeing, some time ago, a list of lots and lots of
test IPv6 addresses. That is, IPv6 addresses that could be fed into
programs to check whether they were properly interpreted.

For a project I am currently working on it would be great not to have to
generate all those fiddly test cases myself, apart from the fact that I
would certainly miss some quirky ones.

So does anyone know where I might have seen this list? It may have been
in the source code to something, or perhaps even someone else's unit
tests.

Don't know what list you're talking about, but here are a few ones extracted from Asterisk:
http://svn.digium.com/svn/asterisk/trunk/tests/test_netsock2.c

        struct parse_test test_vals[] = {
                { "192.168.1.0", 1 },
                { "10.255.255.254", 1 },
                { "172.18.5.4", 1 },
                { "8.8.4.4", 1 },
                { "0.0.0.0", 1 },
                { "127.0.0.1", 1 },
                { "1.256.3.4", 0 },
                { "256.0.0.1", 0 },
                { "1.2.3.4:5060", 1 },
                { "::ffff:5.6.7.8", 1 },
                { "fdf8:f53b:82e4::53", 1 },
                { "fe80::200:5aee:feaa:20a2", 1 },
                { "2001::1", 1 },
                { "2001:0000:4136:e378:8000:63bf:3fff:fdd2", 1 },
                { "2001:0002:6c::430", 1 },
                { "2001:10:240:ab::a", 1 },
                { "2002:cb0a:3cdd:1::1", 1 },
                { "2001:db8:8:4::2", 1 }, /* Documentation only, should never 
be used */
                { "ff01:0:0:0:0:0:0:2", 1 }, /* Multicast */
                { "[fdf8:f53b:82e4::53]", 1 },
                { "[fe80::200:5aee:feaa:20a2]", 1 },
                { "[2001::1]", 1 },
                { "[2001:0000:4136:e378:8000:63bf:3fff:fdd2]:5060", 1 },
                { "2001:0000:4136:e378:8000:63bf:3fff:fdd2:5060", 0 }, /* port, 
but no brackets */
                { "fe80::200::abcd", 0 }, /* multiple zero expansions */
        };

        /* Test various situations with flags = 0 */
        TEST_SPLIT_HOSTPORT("192.168.1.1", 0, "192.168.1.1", "", 1);
        TEST_SPLIT_HOSTPORT("192.168.1.1:5060", 0, "192.168.1.1", "5060", 1);
        TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", 0, "::ffff:5.6.7.8", "", 1);
        TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", 0, "::ffff:5.6.7.8", 
"5060", 1);
        TEST_SPLIT_HOSTPORT("fdf8:f53b:82e4::53", 0, "fdf8:f53b:82e4::53", "", 
1);
        TEST_SPLIT_HOSTPORT("fe80::200:5aee:feaa:20a2", 0, "fe80::200:5aee:feaa:20a2", 
"", 1);
        TEST_SPLIT_HOSTPORT("[fdf8:f53b:82e4::53]", 0, "fdf8:f53b:82e4::53", 
"", 1);
        TEST_SPLIT_HOSTPORT("[fe80::200:5aee:feaa:20a2]:5060", 0, 
"fe80::200:5aee:feaa:20a2", "5060", 1);
        TEST_SPLIT_HOSTPORT("host:port", 0, "host", "port", 1);
        TEST_SPLIT_HOSTPORT("host", 0, "host", "", 1);

        /* Make sure that flag conditions work when they should */
        TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_IGNORE, "192.168.1.1", 
"", 1);
        TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_REQUIRE, "192.168.1.1", 
"5060", 1);
        TEST_SPLIT_HOSTPORT("192.168.1.1", PARSE_PORT_FORBID, "192.168.1.1", 
"", 1);
        TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_IGNORE, "::ffff:5.6.7.8", 
"", 1);
        TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_REQUIRE, 
"::ffff:5.6.7.8", "5060", 1);
        TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", PARSE_PORT_FORBID, "::ffff:5.6.7.8", 
"", 1);

        /* Make sure it fails when flag requirements are not met */
        TEST_SPLIT_HOSTPORT("192.168.1.1", PARSE_PORT_REQUIRE, "<undefined>", 
"<undefined>", 0);
        TEST_SPLIT_HOSTPORT("192.168.1.1:5060", PARSE_PORT_FORBID, "<undefined>", 
"<undefined>", 0);
        TEST_SPLIT_HOSTPORT("::ffff:5.6.7.8", PARSE_PORT_REQUIRE, "<undefined>", 
"<undefined>", 0);
        TEST_SPLIT_HOSTPORT("[::ffff:5.6.7.8]:5060", PARSE_PORT_FORBID, "<undefined>", 
"<undefined>", 0);

Simon
--
DTN made easy, lean, and smart --> http://postellation.viagenie.ca
NAT64/DNS64 open-source        --> http://ecdysis.viagenie.ca
STUN/TURN server               --> http://numb.viagenie.ca
--------------------------------------------------------------------
IETF IPv6 working group mailing list
[email protected]
Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
--------------------------------------------------------------------

Reply via email to