mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
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 <lsm5@redhat.com>
This commit is contained in:
parent
9ff3f4cb1e
commit
3c79df31a4
4 changed files with 5 additions and 30 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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=$!
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# -*- bash -*-
|
||||
|
||||
kill $nc_pid &> /dev/null || true
|
||||
rm -f $OUTFILE
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue