test(dns,eks): skip the Linux-only loopback and /proc cases off Linux (#9493)

This commit is contained in:
Kenshin Okinaka authored and GitHub committed 2026-11-25 22:46:02 -04:00
1 parent 6906face9c
commit 2f2fafd044
2 files changed
+12

No files matched your search

@@ -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);
@@ -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/<pid>/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/<pid>/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/<pid>/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");