8022963: java/net/NetworkInterface/Equals.java fails equality for Windows Teredo Interface
authortyan
Fri, 08 Nov 2013 15:12:30 +0000
changeset 21629 c347092074d9
parent 21628 50fd58446d64
child 21630 58a025b37bff
8022963: java/net/NetworkInterface/Equals.java fails equality for Windows Teredo Interface Reviewed-by: chegar
jdk/test/java/net/MulticastSocket/TestInterfaces.java
jdk/test/java/net/NetworkInterface/Equals.java
--- a/jdk/test/java/net/MulticastSocket/TestInterfaces.java	Fri Nov 08 07:53:57 2013 -0800
+++ b/jdk/test/java/net/MulticastSocket/TestInterfaces.java	Fri Nov 08 15:12:30 2013 +0000
@@ -33,6 +33,8 @@
 
 public class TestInterfaces {
 
+    static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+
     public static void main(String args[]) throws Exception {
         int failures = 0;
 
@@ -85,6 +87,10 @@
                 continue;
             }
 
+            // JDK-8022963, Skip (Windows) Teredo Tunneling seudo-Interface
+            if (isWindows && ni.getDisplayName().contains("Teredo"))
+                continue;
+
             NetworkInterface curr = soc.getNetworkInterface();
             if (!curr.equals(ni)) {
                 System.err.println("MulticastSocket.getNetworkInterface returned: " + curr);
--- a/jdk/test/java/net/NetworkInterface/Equals.java	Fri Nov 08 07:53:57 2013 -0800
+++ b/jdk/test/java/net/NetworkInterface/Equals.java	Fri Nov 08 15:12:30 2013 +0000
@@ -38,6 +38,8 @@
 
 public class Equals {
 
+    static final boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+
     public static void main(String args[]) throws Exception {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         PrintStream bufferedOut = new PrintStream(baos);
@@ -59,6 +61,11 @@
         Enumeration<NetworkInterface> nifs2 = NetworkInterface.getNetworkInterfaces();
         while (nifs2.hasMoreElements()) {
             NetworkInterface ni = nifs2.nextElement();
+
+            // JDK-8022963, Skip (Windows)Teredo Tunneling seudo-Interface
+            if (isWindows && ni.getDisplayName().contains("Teredo"))
+                continue;
+
             NetworkInterface niOrig = nicMap.get(ni.getName());
 
             int h = ni.hashCode();