blob: 91bc9937d8bebd47a1209e1dfcdc58c84ed99182 (
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
|
# -*- sh -*-
#
# test 'stop' endpoints
#
podman pull $IMAGE &>/dev/null
# stop, by name
podman run -dt --name mytop $IMAGE top &>/dev/null
t GET libpod/containers/mytop/json 200 .State.Status=running
t POST libpod/containers/mytop/stop 204
t GET libpod/containers/mytop/json 200 .State.Status~\\\(exited\\\|stopped\\\)
t DELETE libpod/containers/mytop 204
# stop, by ID
# Remember that podman() hides all output; we need to get our CID via inspect
podman run -dt --name mytop $IMAGE top
t GET libpod/containers/mytop/json 200 .State.Status=running
cid=$(jq -r .Id <<<"$output")
t POST libpod/containers/$cid/stop 204
t GET libpod/containers/mytop/json 200 .State.Status~\\\(exited\\\|stopped\\\)
t DELETE libpod/containers/mytop 204
|