From 4307a451531a9d099af769c8d5aa28bc52130e0d Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Wed, 29 Jul 2020 09:55:37 +0200 Subject: [PATCH] Fix IPV6 Scope ID Test (#60360) (#60363) Use real scope id from first available interface instead of `lo` which might not exist on non-Linux platforms. Closes #60332 --- .../elasticsearch/common/network/InetAddressesTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/common/network/InetAddressesTests.java b/server/src/test/java/org/elasticsearch/common/network/InetAddressesTests.java index e73e6c1bc09..7922d3eadc4 100644 --- a/server/src/test/java/org/elasticsearch/common/network/InetAddressesTests.java +++ b/server/src/test/java/org/elasticsearch/common/network/InetAddressesTests.java @@ -21,6 +21,7 @@ import org.elasticsearch.test.ESTestCase; import org.hamcrest.Matchers; import java.net.InetAddress; +import java.net.NetworkInterface; import java.net.UnknownHostException; public class InetAddressesTests extends ESTestCase { @@ -128,9 +129,8 @@ public class InetAddressesTests extends ESTestCase { assertTrue(InetAddresses.isInetAddress(ipStr)); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/60332") - public void testForStringIPv6WithScopeIdInput() throws UnknownHostException { - String ipStr = "0:0:0:0:0:0:0:1%lo"; + public void testForStringIPv6WithScopeIdInput() throws java.io.IOException { + String ipStr = "0:0:0:0:0:0:0:1%" + NetworkInterface.getNetworkInterfaces().nextElement().getName(); InetAddress ipv6Addr = InetAddress.getByName(ipStr); assertEquals(ipv6Addr, InetAddresses.forString(ipStr)); assertTrue(InetAddresses.isInetAddress(ipStr));