summaryrefslogtreecommitdiff
path: root/test/podman_run_exit.bats
blob: 02ccb56eca28ea6014e207f2047f5f9e48945d85 (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
44
45
46
#!/usr/bin/env bats

load helpers

function teardown() {
    cleanup_test
}

function setup() {
    copy_images
}

@test "run exit125 test" {
    run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run --foobar ${ALPINE} ls $tmp
    echo $output
    echo $status != 125
    [ $status -eq 125 ]
}

@test "run exit126 test" {
    run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} foobar
    echo $output
    echo $status != 126
    [ "$status" -eq 126 ]
}

@test "run exit127 test" {
    run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} /etc
    echo $output
    echo $status != 127
    [ "$status" -eq 127 ]
}

@test "run exit0 test" {
    run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} ps
    echo $output
    echo $status != 0
    [ "$status" -eq 0 ]
}

@test "run exit50 test" {
    run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} sh -c "exit 50"
    echo $output
    echo $status != 50
    [ "$status" -eq 50 ]
}