diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-08-03 09:02:18 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-08-11 15:28:18 -0400 |
commit | 67bf11e8c8418d06528bf16b184f77e99a738d05 (patch) | |
tree | 8b122176f9f12e73569b3c864492a2a269860131 /test | |
parent | a1afb2300f1a65a4213753c587ba8a7d66755423 (diff) | |
download | podman-67bf11e8c8418d06528bf16b184f77e99a738d05.tar.gz podman-67bf11e8c8418d06528bf16b184f77e99a738d05.tar.bz2 podman-67bf11e8c8418d06528bf16b184f77e99a738d05.zip |
Fix podman unpause,pause,kill --all to work like podman stop --all
Currently if you execute podman unpause --all, podman pause --all
Podman shows attempts to unpause containers that are not paused
and prints an error. This PR catches this error and only prints errors if
a paused container was not able to be unpaused.
Currently if you execute podman pause --all or podman kill --all, Podman
Podman shows attempts to pause or kill containers that are not running
and prints an error. This PR catches this error and only prints errors if
a running container was not able to be paused or killed.
Also change printing of multiple errors to go to stderr and to prefix
"Error: " in front to match the output of the last error.
Fixes: https://github.com/containers/podman/issues/11098
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/080-pause.bats | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/system/080-pause.bats b/test/system/080-pause.bats index ea4c85f8f..1eb47dcfb 100644 --- a/test/system/080-pause.bats +++ b/test/system/080-pause.bats @@ -57,4 +57,23 @@ load helpers run_podman 125 unpause $cname } +@test "podman unpause --all" { + if is_rootless && ! is_cgroupsv2; then + skip "'podman pause' (rootless) only works with cgroups v2" + fi + + cname=$(random_string 10) + run_podman create --name notrunning $IMAGE + run_podman run -d --name $cname $IMAGE sleep 100 + cid="$output" + run_podman pause $cid + run_podman inspect --format '{{.State.Status}}' $cid + is "$output" "paused" "podman inspect .State.Status" + run_podman unpause --all + is "$output" "$cid" "podman unpause output" + run_podman ps --format '{{.ID}} {{.Names}} {{.Status}}' + is "$output" "${cid:0:12} $cname Up.*" "podman ps on resumed container" + run_podman rm -f $cname + run_podman rm -f notrunning +} # vim: filetype=sh |