mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Cleanup: applyVolumesFrom
Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
This commit is contained in:
@@ -374,6 +374,23 @@ func TestVolumesFromInReadWriteMode(t *testing.T) {
|
||||
logDone("run - volumes from as read write mount")
|
||||
}
|
||||
|
||||
func TestVolumesFromInheritsReadOnly(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test:/test:ro", "busybox", "true")
|
||||
if _, err := runCommand(cmd); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Expect this "rw" mode to be be ignored since the inheritted volume is "ro"
|
||||
cmd = exec.Command(dockerBinary, "run", "--volumes-from", "parent:rw", "busybox", "touch", "/test/file")
|
||||
if _, err := runCommand(cmd); err == nil {
|
||||
t.Fatal("Expected to inherit read-only volume even when passing in `rw`")
|
||||
}
|
||||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("run - volumes from ignores `rw` if inherrited volume is `ro`")
|
||||
}
|
||||
|
||||
// Test for #1351
|
||||
func TestApplyVolumesFromBeforeVolumes(t *testing.T) {
|
||||
cmd := exec.Command(dockerBinary, "run", "--name", "parent", "-v", "/test", "busybox", "touch", "/test/foo")
|
||||
@@ -1181,7 +1198,7 @@ func TestDockerRunWithVolumesIsRecursive(t *testing.T) {
|
||||
|
||||
deleteAllContainers()
|
||||
|
||||
logDone("run - volumes are bind mounted recuursively")
|
||||
logDone("run - volumes are bind mounted recursively")
|
||||
}
|
||||
|
||||
func TestDnsDefaultOptions(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user