Fix: Use ipv6 loopback adress in test_uri
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 18 Feb 2016 17:45:13 +0000 (12:45 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Feb 2016 22:44:11 +0000 (17:44 -0500)
Some older version of Debian/Ubuntu and maybe other distros won't set
localhost to point on ::1 in the system hosts file and use instead a
custom name like ip6-localhost or ipv6-locahost which is not
standardized across distros.

To work around this, use the ipv6 loopback address instead of localhost.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/unit/test_uri.c

index 432e2b3fcea1ed72775d2ae8d986c0eb9527c139..cd95753960006eb301ce440c88a0a042d557d607 100644 (file)
@@ -108,7 +108,7 @@ void test_uri_parsing(void)
                uri = NULL;
        }
 
                uri = NULL;
        }
 
-       s_uri1 = "net6://localhost:8989";
+       s_uri1 = "net6://[::1]:8989";
 
        size = uri_parse(s_uri1, &uri);
 
 
        size = uri_parse(s_uri1, &uri);
 
@@ -125,7 +125,7 @@ void test_uri_parsing(void)
           uri[1].port == 0 &&
           strlen(uri[1].subdir) == 0 &&
           strcmp(uri[0].dst.ipv6, "::1") == 0,
           uri[1].port == 0 &&
           strlen(uri[1].subdir) == 0 &&
           strcmp(uri[0].dst.ipv6, "::1") == 0,
-          "URI set to net6://localhost:8989");
+          "URI set to net6://[::1]:8989");
 
        if (uri) {
                uri_free(uri);
 
        if (uri) {
                uri_free(uri);
This page took 0.025667 seconds and 4 git commands to generate.