Fix unmount when host volume is removed
Fixes #5244 Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael) Upstream-commit: 39103e72a3ca4ff739a4986c4e4849339e08aaf3 Component: engine
This commit is contained in:
27
components/engine/integration-cli/docker_cli_rm_test.go
Normal file
27
components/engine/integration-cli/docker_cli_rm_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRemoveContainerWithRemovedVolume(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--name", "losemyvolumes", "-v", "/tmp/testing:/test", "busybox", "true")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := os.Remove("/tmp/testing"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cmd = exec.Command(dockerBinary, "rm", "-v", "losemyvolumes")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("rm - removed volume")
|
||||
}
|
||||
Reference in New Issue
Block a user