summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-04 12:59:33 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-20 18:51:21 +0000
commit946b4ced544e5988a971da12c7e34a684ab0e39d (patch)
tree026fa6619b6b98a9cf08ec66b8cd6dd27a714736 /test
parent67f06cf1cfda17387bd094f671672c6b51b2c5cd (diff)
downloadpodman-946b4ced544e5988a971da12c7e34a684ab0e39d.tar.gz
podman-946b4ced544e5988a971da12c7e34a684ab0e39d.tar.bz2
podman-946b4ced544e5988a971da12c7e34a684ab0e39d.zip
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 <bbaude@redhat.com> Closes: #214 Approved by: baude
Diffstat (limited to 'test')
-rw-r--r--test/podman_networking.bats21
1 files changed, 21 insertions, 0 deletions
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 ]
+}