integcli: add test to ensure -v /:/ isn't allowed

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 38b005ec69e62d93453ac4013fe6bfa2fccebc5d
Component: engine
This commit is contained in:
unclejack
2014-06-27 19:51:24 +03:00
parent e523e1e304
commit 1e5262e71f

View File

@ -971,3 +971,15 @@ func TestAllowBindMountingRoot(t *testing.T) {
logDone("run - bind mount / as volume")
}
func TestDisallowBindMountingRootToRoot(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-v", "/:/", "busybox", "ls", "/host")
out, _, err := runCommandWithOutput(cmd)
if err == nil {
t.Fatal(out, err)
}
deleteAllContainers()
logDone("run - bind mount /:/ as volume should fail")
}