Revert rm -f deprecation use SIGKILL instead
`rm -f` was originally deprecated in favor of `rm --stop/--kill` since `rm -f` was sending SIGTERM and potentially very slow. Instead this will bring back `rm -f` but use SIGKILL isntead Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83) Upstream-commit: 95f86da641dfec9b3db88e0f0a8457685361a871 Component: engine
This commit is contained in:
@ -57,40 +57,18 @@ func TestRemoveRunningContainer(t *testing.T) {
|
||||
logDone("rm - running container")
|
||||
}
|
||||
|
||||
func TestStopAndRemoveRunningContainer(t *testing.T) {
|
||||
func TestForceRemoveRunningContainer(t *testing.T) {
|
||||
createRunningContainer(t, "foo")
|
||||
|
||||
// Stop then remove with -s
|
||||
cmd := exec.Command(dockerBinary, "rm", "-s", "foo")
|
||||
cmd := exec.Command(dockerBinary, "rm", "-f", "foo")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("rm - running container with --stop=true")
|
||||
}
|
||||
|
||||
func TestKillAndRemoveRunningContainer(t *testing.T) {
|
||||
createRunningContainer(t, "foo")
|
||||
|
||||
// Kill then remove with -k
|
||||
cmd := exec.Command(dockerBinary, "rm", "-k", "foo")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("rm - running container with --kill=true")
|
||||
}
|
||||
|
||||
func TestRemoveContainerWithStopAndKill(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "rm", "-sk", "foo")
|
||||
if _, err := runCommand(cmd); err == nil {
|
||||
t.Fatalf("Expected error: can't use stop and kill simulteanously")
|
||||
}
|
||||
logDone("rm - with --stop=true and --kill=true")
|
||||
logDone("rm - running container with --force=true")
|
||||
}
|
||||
|
||||
func TestContainerOrphaning(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user