From b74e38b042cb32cead9adacbe75256a89e5cb664 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 22 Jan 2018 13:56:08 -0600 Subject: 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 --- test/podman_port.bats | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/podman_port.bats (limited to 'test/podman_port.bats') 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 ] +} -- cgit v1.2.3-54-g00ecf