[lttng-dev] [PATCH lttng-tools] Fix: Use ipv6 loopback adress in test_uri

Jérémie Galarneau jeremie.galarneau at efficios.com
Thu Feb 18 17:45:20 EST 2016


Merged, thanks!

Jérémie

On Thu, Feb 18, 2016 at 12:45 PM, Michael Jeanson <mjeanson at efficios.com> wrote:
> 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 at efficios.com>
> ---
>  tests/unit/test_uri.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/unit/test_uri.c b/tests/unit/test_uri.c
> index 432e2b3..cd95753 100644
> --- a/tests/unit/test_uri.c
> +++ b/tests/unit/test_uri.c
> @@ -108,7 +108,7 @@ void test_uri_parsing(void)
>                 uri = NULL;
>         }
>
> -       s_uri1 = "net6://localhost:8989";
> +       s_uri1 = "net6://[::1]:8989";
>
>         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 set to net6://localhost:8989");
> +          "URI set to net6://[::1]:8989");
>
>         if (uri) {
>                 uri_free(uri);
> --
> 2.7.0
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list