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

Reviewed-by: jpai
  • Loading branch information
Mark Sheppard committed Dec 7, 2023
1 parent 49fff01 commit 0048f1d
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0048f1d

Please sign in to comment.