mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
make client side know container removal in progress
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package daemon
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
@@ -34,9 +35,9 @@ func TestContainerDoubleDelete(t *testing.T) {
|
||||
// Mark the container as having a delete in progress
|
||||
container.SetRemovalInProgress()
|
||||
|
||||
// Try to remove the container when its start is removalInProgress.
|
||||
// It should ignore the container and not return an error.
|
||||
if err := daemon.ContainerRm(container.ID, &types.ContainerRmConfig{ForceRemove: true}); err != nil {
|
||||
t.Fatal(err)
|
||||
// Try to remove the container when its state is removalInProgress.
|
||||
// It should return an error indicating it is under removal progress.
|
||||
if err := daemon.ContainerRm(container.ID, &types.ContainerRmConfig{ForceRemove: true}); err == nil {
|
||||
t.Fatalf("expected err: %v, got nil", fmt.Sprintf("removal of container %s is already in progress", container.ID))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user