提交 5a481fe2 编写于 作者: X xiaofeya

8134989: java/net/MulticastSocket/TestInterfaces.java failed due to unexpected IP address

Reviewed-by: rriggs, chegar, msheppar
上级 e86233d8
/* /*
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -24,10 +24,15 @@ ...@@ -24,10 +24,15 @@
/* /*
* @test * @test
* @bug 4422122 * @bug 4422122
* @key intermittent
* @summary Test that MulticastSocket.getInterface returns the * @summary Test that MulticastSocket.getInterface returns the
* same InetAddress set by MulticastSocket.setInterface * same InetAddress set by MulticastSocket.setInterface
* @library /test/lib
* @build jdk.test.lib.NetworkConfiguration
* jdk.test.lib.Platform
* @run main TestInterfaces
*/ */
import jdk.test.lib.NetworkConfiguration;
import java.net.*; import java.net.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
...@@ -52,6 +57,10 @@ public class TestInterfaces { ...@@ -52,6 +57,10 @@ public class TestInterfaces {
if (isWindows && dName != null && dName.contains("Teredo")) if (isWindows && dName != null && dName.contains("Teredo"))
continue; continue;
// Skip those interfaces not up or not support multicast
if (!ni.isUp() || !ni.supportsMulticast())
continue;
/* /*
* Test MulticastSocket.getInterface * Test MulticastSocket.getInterface
*/ */
...@@ -115,6 +124,8 @@ public class TestInterfaces { ...@@ -115,6 +124,8 @@ public class TestInterfaces {
} }
if (failures > 0) { if (failures > 0) {
System.err.println("********************************");
NetworkConfiguration.printSystemConfiguration(System.err);
System.out.println("********************************"); System.out.println("********************************");
throw new Exception(failures + " test(s) failed!!!"); throw new Exception(failures + " test(s) failed!!!");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册