From 3c79df31a475393e0465640361069672e7d636e0 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Tue, 7 Apr 2026 13:21:11 -0400 Subject: [PATCH] Fix pasta_opts compose test to verify MTU option Use podman exec to check ip link MTU instead of ncat-based host connectivity test which does not actually validate pasta options. Signed-off-by: Lokesh Mandvekar --- test/compose/pasta_opts/docker-compose.yml | 4 ++-- test/compose/pasta_opts/setup.sh | 8 -------- test/compose/pasta_opts/teardown.sh | 4 ---- test/compose/pasta_opts/tests.sh | 19 +++---------------- 4 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 test/compose/pasta_opts/setup.sh delete mode 100644 test/compose/pasta_opts/teardown.sh diff --git a/test/compose/pasta_opts/docker-compose.yml b/test/compose/pasta_opts/docker-compose.yml index 9af3fafdeb..ba8453b7d4 100644 --- a/test/compose/pasta_opts/docker-compose.yml +++ b/test/compose/pasta_opts/docker-compose.yml @@ -1,5 +1,5 @@ services: alpine: image: alpine - network_mode: "pasta:--ipv4-only,-a,10.0.2.0,-n,24,-g,10.0.2.2,--dns-forward,10.0.2.3,--mtu,1280,--no-ndp,--no-dhcpv6,--no-dhcp" - command: sh -c "echo teststring | nc 10.0.2.2 5001" + network_mode: "pasta:--ipv4-only,--mtu,1280" + command: ["top"] diff --git a/test/compose/pasta_opts/setup.sh b/test/compose/pasta_opts/setup.sh deleted file mode 100644 index 03e250d345..0000000000 --- a/test/compose/pasta_opts/setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -# -*- bash -*- - -# create tempfile to store nc output -OUTFILE=$(mktemp) -# listen on a port, the container will try to connect to it -ncat -l 5001 > $OUTFILE & - -nc_pid=$! diff --git a/test/compose/pasta_opts/teardown.sh b/test/compose/pasta_opts/teardown.sh deleted file mode 100644 index 091a4b9c72..0000000000 --- a/test/compose/pasta_opts/teardown.sh +++ /dev/null @@ -1,4 +0,0 @@ -# -*- bash -*- - -kill $nc_pid &> /dev/null || true -rm -f $OUTFILE diff --git a/test/compose/pasta_opts/tests.sh b/test/compose/pasta_opts/tests.sh index 2d41311ad8..dd5c672d74 100644 --- a/test/compose/pasta_opts/tests.sh +++ b/test/compose/pasta_opts/tests.sh @@ -1,19 +1,6 @@ # -*- bash -*- -expected="teststring" +ctr_name="pasta_opts-alpine-1" -# Reading from the nc socket is flaky because docker-compose only starts -# the containers. We cannot know at this point if the container did already -# send the message. Give the container 5 seconds time to send the message -# to prevent flakes. -container_timeout=5 -while [ $container_timeout -gt 0 ]; do - output="$(< $OUTFILE)" - if [ -n "$output" ]; then - break - fi - sleep 1 - container_timeout=$(($container_timeout - 1)) -done - -is "$output" "$expected" "$testname : nc received teststring" +podman exec "$ctr_name" ip link +like "$output" "mtu 1280" "$testname : mtu is set to 1280"