From 2f2fafd044923dc12de63b5214eafd1a4eacd504 Mon Sep 17 00:00:00 2001 From: Kenshin Okinaka Date: Thu, 26 Nov 2026 11:46:02 +0900 Subject: [PATCH] test(dns,eks): skip the Linux-only loopback and /proc cases off Linux (#9493) --- .../aws/core/common/dns/ElbV2AliasDnsIntegrationTest.java | 4 ++++ .../floci/aws/services/eks/EksPodNetworkRoutingTest.java | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/test/java/io/floci/aws/core/common/dns/ElbV2AliasDnsIntegrationTest.java b/src/test/java/io/floci/aws/core/common/dns/ElbV2AliasDnsIntegrationTest.java index 21e6fc9fac..8aa79d0b95 100644 --- a/src/test/java/io/floci/aws/core/common/dns/ElbV2AliasDnsIntegrationTest.java +++ b/src/test/java/io/floci/aws/core/common/dns/ElbV2AliasDnsIntegrationTest.java @@ -5,6 +5,7 @@ import io.quarkus.test.junit.QuarkusTest; import io.vertx.core.Vertx; import io.vertx.core.datagram.DatagramSocket; import jakarta.inject.Inject; +import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import software.amazon.awssdk.regions.Region; @@ -33,6 +34,7 @@ import java.util.concurrent.TimeUnit; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; /** Signed management calls followed by real UDP queries through CDI-discovered DNS sources. */ @QuarkusTest @@ -54,6 +56,8 @@ class ElbV2AliasDnsIntegrationTest { void publicAliasValidatesItsTargetAcrossAccounts( String scheme, String type, int queryType, String listenerAddress, boolean evaluateTargetHealth) throws Exception { + assumeTrue("127.0.0.1".equals(listenerAddress) || OS.current() == OS.LINUX, + "binding " + listenerAddress + " needs Linux, which routes all of 127/8 locally"); try (Ec2Client ec2 = AwsTestClients.create(Ec2Client.builder(), "730000000001", Region.EU_WEST_1); ElasticLoadBalancingV2Client elb = AwsTestClients.create( ElasticLoadBalancingV2Client.builder(), "730000000001", Region.EU_WEST_1); diff --git a/src/test/java/io/floci/aws/services/eks/EksPodNetworkRoutingTest.java b/src/test/java/io/floci/aws/services/eks/EksPodNetworkRoutingTest.java index 597f5f1375..6404cf44f1 100644 --- a/src/test/java/io/floci/aws/services/eks/EksPodNetworkRoutingTest.java +++ b/src/test/java/io/floci/aws/services/eks/EksPodNetworkRoutingTest.java @@ -4,6 +4,8 @@ import com.sun.net.httpserver.HttpServer; import io.floci.aws.testing.HelperShellFixture; import io.floci.aws.testing.ParallelLocks; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.params.ParameterizedTest; @@ -197,7 +199,9 @@ class EksPodNetworkRoutingTest { * forward stops it, while its PID file still names it, and takes its address off the loopback. The forward runs * traced, so the test sees the {@code kill} it sends. */ + // The shell identifies the relay through /proc//comm and cmdline, which only Linux has. @Test + @EnabledOnOs(OS.LINUX) void imdsForwardRetiresTheRelayAnOlderFlociRan(@TempDir Path dir) throws Exception { Path bin = fakeStockNode(dir); HelperShellFixture.writeTool(bin, "ip", "echo \"$*\" >> '" + dir.resolve("ip-calls") + "'\n" @@ -242,7 +246,9 @@ class EksPodNetworkRoutingTest { * the rules in front of it went: the removal stops it, while its PID file still names it, and takes its address * off the loopback. The removal runs traced, so the test sees the {@code kill} it sends. */ + // The shell identifies the relay through /proc//comm and cmdline, which only Linux has. @Test + @EnabledOnOs(OS.LINUX) void podIdentityRemovalRetiresTheRelayAnOlderFlociRan(@TempDir Path dir) throws Exception { Path bin = fakeStockNode(dir); HelperShellFixture.writeTool(bin, "ip", "echo \"$*\" >> '" + dir.resolve("ip-calls") + "'\n" @@ -273,7 +279,9 @@ class EksPodNetworkRoutingTest { * A PID file that names another process, here a socat relaying IMDS, leaves that process running: the traced * removal sends it no {@code kill}. */ + // The shell identifies the relay through /proc//comm and cmdline, which only Linux has. @Test + @EnabledOnOs(OS.LINUX) void podIdentityRemovalLeavesTheProcessAStalePidFileNames(@TempDir Path dir) throws Exception { Path bin = fakeStockNode(dir); Process imdsRelay = startFakeRelay(bin, "169.254.169.254");