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.
@@ -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

3 comments on commit 0048f1d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@SoniaZaldana
Copy link
Member

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 0048f1d Dec 15, 2023

Choose a reason for hiding this comment

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

@SoniaZaldana the backport was successfully created on the branch backport-SoniaZaldana-0048f1da in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 0048f1da from the openjdk/jdk repository.

The commit being backported was authored by Mark Sheppard on 7 Dec 2023 and was reviewed by Jaikiran Pai.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-SoniaZaldana-0048f1da:backport-SoniaZaldana-0048f1da
$ git checkout backport-SoniaZaldana-0048f1da
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-SoniaZaldana-0048f1da

Please sign in to comment.