From 946b4ced544e5988a971da12c7e34a684ab0e39d Mon Sep 17 00:00:00 2001 From: baude Date: Thu, 4 Jan 2018 12:59:33 -0600 Subject: Enable port bindings Set up nbetworking ports for the following use cases: * bind the same port between host and container * bind a specific host port to a different container port * bind a random host port to a specific container port Signed-off-by: baude Closes: #214 Approved by: baude --- test/podman_networking.bats | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/podman_networking.bats') diff --git a/test/podman_networking.bats b/test/podman_networking.bats index ba30a9897..b2196b4bc 100644 --- a/test/podman_networking.bats +++ b/test/podman_networking.bats @@ -27,3 +27,24 @@ function setup() { echo "$output" [ "$status" -eq 0 ] } + +@test "expose port 222" { + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -dt --expose 222-223 ${ALPINE} /bin/sh + echo "$output" + [ "$status" -eq 0 ] + run bash -c "iptables -t nat -L" + echo "$output" + [ "$status" -eq 0 ] + run bash -c "iptables -t nat -L | grep 223" + echo "$output" + [ "$status" -eq 0 ] +} + +@test "expose host port 80 to container port 8000" { + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -dt -p 80:8000 ${ALPINE} /bin/sh + echo "$output" + [ "$status" -eq 0 ] + run bash -c "iptables -t nat -L | grep 8000" + echo "$output" + [ "$status" -eq 0 ] +} -- cgit v1.2.3-54-g00ecf