1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_cli_rm_test.go
Michael Crosby 39103e72a3 Fix unmount when host volume is removed
Fixes #5244
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-04-14 12:43:01 +00:00

27 lines
545 B
Go

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")
}