mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 05:31:47 +00:00
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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user