Regarding 8220575: Correctly format test URI's that contain a retrieved IPv6 address
Arthur Eubanks
aeubanks at google.com
Wed Mar 13 17:43:41 UTC 2019
SGTM.
Sort of related:
Some tests specifically test the IP address as opposed to "localhost" (e.g.
some security tests), we'll need to figure out what to do with those.
Martin suggested looping through all available loopback addresses rather
than hardcoding them. In that case we'll need helper test functions to
return loopback addresses (and test that it actually returns all available
loopback addresses).
On Wed, Mar 13, 2019 at 10:33 AM Chris Hegarty <chris.hegarty at oracle.com>
wrote:
> I filed the 8220575 [1] that tracks "Correctly format test URI's that
> contain a retrieved IPv6 address"
>
> Regarding fixing tests that incorrectly use IPv6 addresses in URL's or
> URI's, without enclosing the address within '[' and ']' ( square
> brackets ). These IPv6 addresses typically come from either of: 1)
> the InetAddress.getLoopbackAddress().getHostAddress(), or 2)
> InetAddress.getLocalHost().getHostAddress(). I think that is most cases
> it should be possible to just replace the use of `getHostAddress` with
> `getHostName`. This defers the actual lookup to the system configured
> name service ( rather than trying to encode IPv6 addresses in the
> test ).
>
> Also, URL's / URI's that hardcode "127.0.0.1", can ( in most cases )
> just be replaced with InetAddress.getLoopbackAddress().getHostName().
>
> I've followed the above advise on a few tests and it seems to be working
> out ok, so far.
>
> -Chris.
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8220575
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20190313/4722c578/attachment.html>
More information about the net-dev
mailing list