Skip to content

Commit

Permalink
8263256: Test java/net/Inet6Address/serialize/Inet6AddressSerializati…
Browse files Browse the repository at this point in the history
…onTest.java fails due to dynamic reconfigurations of network interface during test

Backport-of: 0048f1da4ce83b3de5d5ac074f969437f7b3024e
  • Loading branch information
shipilev committed Dec 19, 2023
1 parent ee7748a commit 80b5f72
Showing 1 changed file with 17 additions and 4 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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
Expand Down Expand Up @@ -38,10 +38,16 @@
import java.util.Enumeration;
import java.util.List;

import jdk.test.lib.Platform;
import jdk.test.lib.NetworkConfiguration;

/**
* @test
* @bug 8007373
* @summary jdk7 backward compatibility serialization problem
* @library /test/lib
* @build jdk.test.lib.NetworkConfiguration
* @run main/othervm Inet6AddressSerializationTest
*/

public class Inet6AddressSerializationTest {
Expand Down Expand Up @@ -177,12 +183,19 @@ static void testAllNetworkInterfaces() throws Exception {
.getNetworkInterfaces(); e.hasMoreElements();) {
NetworkInterface netIF = e.nextElement();
// Skip (Windows)Teredo Tunneling Pseudo-Interface
String dName = netIF.getDisplayName();
if (isWindows) {
String dName = netIF.getDisplayName();
if (dName != null && dName.contains("Teredo")) {
continue;
}
}
// skip awdl and llw interfaces on macosx
if (Platform.isOSX()) {
if((dName != null) &&
((dName.contains("awdl")) || (dName.contains("llw")))) {
continue;
}
}
for (Enumeration<InetAddress> iadrs = netIF.getInetAddresses(); iadrs
.hasMoreElements();) {
InetAddress iadr = iadrs.nextElement();
Expand Down Expand Up @@ -622,8 +635,8 @@ static void assertNetworkInterfaceEqual(
+ deserializedNetworkInterface);
failed = true;
}
} else if (!expectedNetworkInterface
.equals(deserializedNetworkInterface)) {
} else if (!NetworkConfiguration.isSameInterface(expectedNetworkInterface,
deserializedNetworkInterface)) {
System.err.println("Error checking "
+ // versionStr +
" NetworkInterface, expected:" + expectedNetworkInterface
Expand Down

1 comment on commit 80b5f72

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.