From 03d32d05ac15c7b542d8761d8a7839865f362386 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 28 May 2020 13:43:59 -0600 Subject: system tests : more tests - exec: add test for #5046, in which conmon swallowed chars on a large byte transfer - pod: add 'pod exists' tests, both positive and negative; consolidate tests; add '--label', and check in 'pod inspect' add 'pod ps' tests - networking: add test for #5466, in which detached run with --userns=keep-id would not forward a port Signed-off-by: Ed Santiago --- test/system/500-networking.bats | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/system/500-networking.bats') diff --git a/test/system/500-networking.bats b/test/system/500-networking.bats index cd836610b..c9d1984d0 100644 --- a/test/system/500-networking.bats +++ b/test/system/500-networking.bats @@ -60,4 +60,27 @@ load helpers run_podman rmi busybox } +# Issue #5466 - port-forwarding doesn't work with this option and -d +@test "podman networking: port with --userns=keep-id" { + skip_if_remote + + # FIXME: randomize port, and create second random host port + myport=54321 + + # Container will exit as soon as 'nc' receives input + run_podman run -d --userns=keep-id -p 127.0.0.1:$myport:$myport \ + $IMAGE nc -l -p $myport + cid="$output" + + # emit random string, and check it + teststring=$(random_string 30) + echo "$teststring" | nc 127.0.0.1 $myport + + run_podman logs $cid + is "$output" "$teststring" "test string received on container" + + # Clean up + run_podman rm $cid +} + # vim: filetype=sh -- cgit v1.2.3-54-g00ecf