[ipv6] Regarding 8220673: Add test library support for determining platform IP support

Arthur Eubanks aeubanks at google.com
Mon May 6 23:50:38 UTC 2019


>
> 1. IPSupport needs to read system properties, attempts
>     to bind sockets etc... I wonder how that might interact
>     with tests that use a security manager, as some of these
>     operations may throw a SecurityException.
>     Maybe some double checking would be in order for those.
>
IIUC, a security manager that disallows everything would prevent the code
in IPSupport from working at all, and there's no way to get around it with
doPrivileged() since IPSupport and System.getProperty() are not in the same
protection domain. So something like IPSupport would need to be in
java.base, which doesn't make sense.
None of the tests touched in this change start failing. Given that fact,
does it make sense that tests in the future that test SecurityManagers and
networking should not use IPSupport, since it would be unreliable?
And what do you mean by double checking?

>
> 2. I would also be more comfortable if
>     skipIfCurrentConfigurationIsInvalid() (and possibly
>     the static initializer too?), could throw an
>     AssertionError if it finds that neither IPv4 nor IPv6
>     are available on a system. I'm concerned that a bug
>     that e.g. prevents to bind any socket would go unnoticed
>     if all tests are skipped...
>
hasIPv4 and hasIPv6 will both be false when IPv4 is not available
and java.net.preferIPv4Stack is true. In this case we should throw a
jtreg.SkippedException, not an AssertionError.
We can throw an AssertionError if java.net.preferIPv4Stack is not true and
both IPv4 and IPv6 are not available (meaning there's something wrong with
the system). This should catch things like binds not working.

New webrev (only IPSupport was changed):
http://cr.openjdk.java.net/~aeubanks/8220673/webrev.02/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20190506/4acee787/attachment.html>


More information about the net-dev mailing list