diff options
author | baude <bbaude@redhat.com> | 2018-01-22 13:56:08 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2018-01-23 08:54:57 -0600 |
commit | b74e38b042cb32cead9adacbe75256a89e5cb664 (patch) | |
tree | ef61dc8a9e6ae41f46dea5fc1a1d22f78b1d4b70 /test/podman_port.bats | |
parent | a03e040f0bb1d32645879b2c8bec7c5e1fe0561f (diff) | |
download | podman-b74e38b042cb32cead9adacbe75256a89e5cb664.tar.gz podman-b74e38b042cb32cead9adacbe75256a89e5cb664.tar.bz2 podman-b74e38b042cb32cead9adacbe75256a89e5cb664.zip |
podman port
podman port reports the port mappings per container. it can be used
to report the ports ofa single container or latest container or all
containers.
in the case of a single container, the user can add an option filter for
port and protocol.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/podman_port.bats')
-rw-r--r-- | test/podman_port.bats | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/podman_port.bats b/test/podman_port.bats new file mode 100644 index 000000000..d13227b3c --- /dev/null +++ b/test/podman_port.bats @@ -0,0 +1,43 @@ +#!/usr/bin/env bats + +load helpers + +function teardown() { + cleanup_test +} + +function setup() { + copy_images +} + +@test "podman port all and latest" { + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -a -l + echo "$output" + echo "$status" + [ "$status" -ne 0 ] +} + +@test "podman port all and extra" { + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -a foobar + echo "$output" + echo "$status" + [ "$status" -ne 0 ] +} + +@test "podman port nginx" { + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run -dt -P docker.io/library/nginx:latest + echo "$output" + [ "$status" -eq 0 ] + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -l + echo "$output" + [ "$status" -eq 0 ] + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -l 80 + echo "$output" + [ "$status" -eq 0 ] + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -l 80/tcp + echo "$output" + [ "$status" -eq 0 ] + run ${PODMAN_BINARY} ${PODMAN_OPTIONS} port -a + echo "$output" + [ "$status" -eq 0 ] +} |