8129510: java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java should exclude testing the Teredo tunneling interface on Windows
authorbpb
Tue, 23 Jun 2015 09:46:22 -0700
changeset 31252 b495f68ca12c
parent 31251 f13b582c8179
child 31257 ae0369eaf0dc
8129510: java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java should exclude testing the Teredo tunneling interface on Windows Summary: Suppress testing the Teredo tunneling interface on Windows. Reviewed-by: chegar
jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java
--- a/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Tue Jun 23 16:36:04 2015 +0300
+++ b/jdk/test/java/net/Inet6Address/serialize/Inet6AddressSerializationTest.java	Tue Jun 23 09:46:22 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -49,6 +49,8 @@
 
     static boolean failed;
 
+    static boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+
     public static final int LOOPBACK_SCOPE_ID = 0;
 
     public static final byte[] IN6ADDR_ANY_INIT = { (byte) 0x00, (byte) 0x00,
@@ -175,6 +177,13 @@
         for (Enumeration<NetworkInterface> e = NetworkInterface
                 .getNetworkInterfaces(); e.hasMoreElements();) {
             NetworkInterface netIF = e.nextElement();
+            // Skip (Windows)Teredo Tunneling Pseudo-Interface
+            if (isWindows) {
+                String dName = netIF.getDisplayName();
+                if (dName != null && dName.contains("Teredo")) {
+                    continue;
+                }
+            }
             for (Enumeration<InetAddress> iadrs = netIF.getInetAddresses(); iadrs
                     .hasMoreElements();) {
                 InetAddress iadr = iadrs.nextElement();