Hi Mark and Roger,

    thanks for the comments. Adjusted the test to just simply print information for all network interfaces on failing.

Webrev:

     http://cr.openjdk.java.net/~xiaofeya/8134989/webrev.01/

Thanks,
Felix
On 2017/9/1 22:44, Mark Sheppard wrote:
Hi
  it's  worth noting that there is diagnostic output for each of the test scenarios, and that for a failure scenario the details of the network interface associated with the failure is displayed.

a typical failure scenario for this test is where a host has multiple network interfaces configured with an IPv4 address and an unassigned IPv6 address. The unassigned IPv6 address causes problems in the MulticastSocket::getInterface call flow
which in turn uses NetworkInterface::getByInetAddress

this has been rectified in JDK10, afaik, by https://bugs.openjdk.java.net/browse/JDK-8179559

also, for the above configuration scenario, i.e. multiple network interfaces configured with unassigned IPv6 address, the findInterfacewithDupAddress may not show duplicate addresses as the scope id will be different. Would the ifconfig command allow two different network interfaces to be configured with the same IP address? Not sure, but would expect not. Also would expect (IPv6) the scope id and index to be different.

NetworkConfiguration.printSystemConfiguration() for a complete diagnostic is a possible alternative.

regards
Mark

On 01/09/2017 14:41, Roger Riggs wrote:
Hi Felix,

Looks ok; though could be simpler to just print all the addresses of all NIs.

findIntefacesWithDupAddress could use streams more effectively (if its worth the time to rewrite).

The inetAddresses() method on NetworkInterface produces a stream of InetAddress which could
be filtered by "ia" and use anyMatch:.

Maybe something like:

List<NetworkInterface> nis = NetworkInterface.networkInterfaces()
                    .filter(i -> !i.equals(ni))
                    .filter(i -> i.inetAddresses().anyMatch(n -> n.equals(ia)))
                    .collect(Collectors.toList());

$.02, Roger

On 9/1/2017 3:47 AM, Felix Yang wrote:
Hi there,

    please review a test patch for isolating a network configuration issue, which led to TestInterfaces failing from time to time.

Bug:

    https://bugs.openjdk.java.net/browse/JDK-8134989

Webrev:

    http://cr.openjdk.java.net/~xiaofeya/8134989/webrev.00/

Thanks,

Felix




Reply via email to