mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05: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:
parent
a1b6f350e8
commit
38b005ec69
1 changed files with 12 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue