mirror of
https://github.com/docker/docs.git
synced 2026-03-30 07:48:52 +07:00
integcli: add test to ensure -v /:/ isn't allowed
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user