Ensure that ro mounts are remounted

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby
2014-04-07 18:23:22 -07:00
parent 8c3eb900de
commit b6042f252d
2 changed files with 20 additions and 2 deletions
+11
View File
@@ -301,3 +301,14 @@ func TestDockerRunWithRelativePath(t *testing.T) {
logDone("run - volume with relative path")
}
func TestVolumesMountedAsReadonly(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "-v", "/test:/test:ro", "busybox", "touch", "/test/somefile")
if code, err := runCommand(cmd); err == nil || code == 0 {
t.Fatalf("run should fail because volume is ro: exit code %d", code)
}
deleteAllContainers()
logDone("run - volumes as readonly mount")
}