Hi,

here is a fix for the MulticastSocket tests failing on AIX (in certain 
sceanrios):

Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8207404.0/
Bug: https://bugs.openjdk.java.net/browse/JDK-8207404

First of all, I "modernized" the testcases 
test/jdk/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java and 
test/jdk/java/net/MulticastSocket/Test.java to make use of 
test/lib/jdk/test/lib/NetworkConfiguration.java which probes for the network 
configuration and returns lists of local interfaces or addresses for certain 
use cases. In NetworkConfiguration.java I made some cleanups and enhancements 
which will hopefully find some appreciation. These 3 tests will now also be 
executed with and without -Djava.net.preferIPv4Stack=true.

The actual fixes are:
test/jdk/java/net/MulticastSocket/JoinLeave.java:
test/jdk/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java:
-> NetworkConfiguration.ip4MulticastInterfaces() will now, on AIX, in a 
scenario where IPv6 is available, filter out interfaces that only have IPv4 
addresses (line 121ff in test/lib/jdk/test/lib/NetworkConfiguration.java)

test/jdk/java/net/MulticastSocket/Test.java:
-> The test for node local multicasting is only executed, when 
NetworkConfiguration::hasTestableIPv6Address is true. For AIX it'll be the case 
only if a "real" IPv6 address exists (on some interface) which is not loopback 
or wildcard. This is how it has already been for Solaris. For other operating 
systems, any IPv6 address on any interface is sufficient for running the test. 
The coding for the AIX/Solaris check can be found in line 66ff of 
test/lib/jdk/test/lib/NetworkConfiguration.java.

As it is a test only fix, I request to do it in JDK12.

Thanks & Best regards
Christoph

Reply via email to