summaryrefslogtreecommitdiff
path: root/test/podman_port.bats
blob: d13227b3c27f739ff4e45dc773007524052056e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 ]
}