test/jdk/java/net/MulticastSocket/Promiscuous.java
changeset 54770 62b6e7587b1f
parent 47216 71c04702a3d5
child 54811 9db7c0f561a6
equal deleted inserted replaced
54769:925ee7a89325 54770:62b6e7587b1f
    21  * questions.
    21  * questions.
    22  *
    22  *
    23 
    23 
    24 /* @test
    24 /* @test
    25  * @bug 8014499
    25  * @bug 8014499
       
    26  * @library /test/lib
    26  * @summary Test for interference when two sockets are bound to the same
    27  * @summary Test for interference when two sockets are bound to the same
    27  *          port but joined to different multicast groups
    28  *          port but joined to different multicast groups
    28  * @run main Promiscuous
    29  * @run main Promiscuous
    29  * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
    30  * @run main/othervm -Djava.net.preferIPv4Stack=true Promiscuous
    30  */
    31  */
    31 
    32 
    32 import java.io.IOException;
    33 import java.io.IOException;
    33 import static java.lang.System.out;
    34 import static java.lang.System.out;
    34 import java.net.*;
    35 import java.net.*;
       
    36 import jdk.test.lib.net.IPSupport;
    35 
    37 
    36 public class Promiscuous {
    38 public class Promiscuous {
    37 
    39 
    38     static final int TIMEOUT =  5 * 1000; // 5 secs
    40     static final int TIMEOUT =  5 * 1000; // 5 secs
    39     static int id = 1000;
    41     static int id = 1000;
   111             mc2.leaveGroup(group2);
   113             mc2.leaveGroup(group2);
   112         }
   114         }
   113     }
   115     }
   114 
   116 
   115     public static void main(String args[]) throws IOException {
   117     public static void main(String args[]) throws IOException {
       
   118         IPSupport.skipIfCurrentConfigurationIsInvalid();
       
   119 
   116         String os = System.getProperty("os.name");
   120         String os = System.getProperty("os.name");
   117 
   121 
   118         // Requires IP_MULTICAST_ALL on Linux (new since 2.6.31) so skip
   122         // Requires IP_MULTICAST_ALL on Linux (new since 2.6.31) so skip
   119         // on older kernels. Note that we skip on <= version 3 to keep the
   123         // on older kernels. Note that we skip on <= version 3 to keep the
   120         // parsing simple
   124         // parsing simple