mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00

Compat api for containers/stop should take -1 value Add support for `podman stop --time -1` Add support for `podman restart --time -1` Add support for `podman rm --time -1` Add support for `podman pod stop --time -1` Add support for `podman pod rm --time -1` Add support for `podman volume rm --time -1` Add support for `podman network rm --time -1` Fixes: https://github.com/containers/podman/issues/17542 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
35 lines
1.1 KiB
Bash
35 lines
1.1 KiB
Bash
# -*- 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 200
|
|
|
|
# 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 200
|
|
|
|
# Remember that podman() hides all output; we need to get our CID via inspect
|
|
podman run -dt --name mytop $IMAGE top
|
|
|
|
t GET containers/mytop/json 200 .State.Status=running
|
|
cid=$(jq -r .Id <<<"$output")
|
|
t POST containers/$cid/stop?t=-1 204
|
|
t POST "containers/$cid/wait" 200
|
|
t GET containers/mytop/json 200 .State.Status~\\\(exited\\\|stopped\\\)
|
|
t DELETE containers/mytop 204
|