8024675: java/net/NetworkInterface/UniqueMacAddressesTest.java fails on Windows
Summary: amended test to add active, i.e. isUp(), NetworkInterfaces to test list
Reviewed-by: alanb, chegar
--- a/jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java Thu Sep 12 14:22:53 2013 -0700
+++ b/jdk/test/java/net/NetworkInterface/UniqueMacAddressesTest.java Fri Sep 13 12:20:53 2013 +0100
@@ -118,11 +118,14 @@
NetworkInterface netIf = null;
while (nis.hasMoreElements()) {
netIf = (NetworkInterface) nis.nextElement();
- macAddr = netIf.getHardwareAddress();
- if (macAddr != null) {
- System.out
- .println("Adding NetworkInterface " + netIf.getName());
- networkInterfaceList.add(netIf);
+ if (netIf.isUp()) {
+ macAddr = netIf.getHardwareAddress();
+ if (macAddr != null) {
+ System.out.println("Adding NetworkInterface "
+ + netIf.getName() + " with mac address "
+ + createMacAddressString(netIf));
+ networkInterfaceList.add(netIf);
+ }
}
}
}