mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +08:00
@ -108,10 +108,13 @@ func kill(_ *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, r := range responses {
|
for _, r := range responses {
|
||||||
if r.Err == nil {
|
switch {
|
||||||
fmt.Println(r.RawInput)
|
case r.Err != nil:
|
||||||
} else {
|
|
||||||
errs = append(errs, r.Err)
|
errs = append(errs, r.Err)
|
||||||
|
case r.RawInput != "":
|
||||||
|
fmt.Println(r.RawInput)
|
||||||
|
default:
|
||||||
|
fmt.Println(r.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return errs.PrintErrors()
|
return errs.PrintErrors()
|
||||||
|
@ -116,4 +116,18 @@ load helpers
|
|||||||
is "$output" "Error: valid signals are 1 through 64" "podman create"
|
is "$output" "Error: valid signals are 1 through 64" "podman create"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "podman kill - print IDs or raw input" {
|
||||||
|
# kill -a must print the IDs
|
||||||
|
run_podman run --rm -d $IMAGE top
|
||||||
|
ctrID="$output"
|
||||||
|
run_podman kill -a
|
||||||
|
is "$output" "$ctrID"
|
||||||
|
|
||||||
|
# kill $input must print $input
|
||||||
|
cname=$(random_string)
|
||||||
|
run_podman run --rm -d --name $cname $IMAGE top
|
||||||
|
run_podman kill $cname
|
||||||
|
is "$output" $cname
|
||||||
|
}
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
Reference in New Issue
Block a user