... | ... |
@@ -1067,6 +1067,7 @@ func TestBuildADDLocalAndRemoteFilesWithCache(t *testing.T) { |
1067 | 1067 |
logDone("build - add local and remote file with cache") |
1068 | 1068 |
} |
1069 | 1069 |
|
1070 |
+// TODO: TestCaching |
|
1070 | 1071 |
func TestBuildADDLocalAndRemoteFilesWithoutCache(t *testing.T) { |
1071 | 1072 |
name := "testbuildaddlocalandremotefilewithoutcache" |
1072 | 1073 |
defer deleteImages(name) |
... | ... |
@@ -1101,3 +1102,34 @@ func TestBuildADDLocalAndRemoteFilesWithoutCache(t *testing.T) { |
1101 | 1101 |
} |
1102 | 1102 |
logDone("build - add local and remote file without cache") |
1103 | 1103 |
} |
1104 |
+ |
|
1105 |
+func TestBuildWithVolumeOwnership(t *testing.T) { |
|
1106 |
+ name := "testbuildimg" |
|
1107 |
+ defer deleteImages(name) |
|
1108 |
+ |
|
1109 |
+ _, err := buildImage(name, |
|
1110 |
+ `FROM busybox:latest |
|
1111 |
+ RUN mkdir /test && chown daemon:daemon /test && chmod 0600 /test |
|
1112 |
+ VOLUME /test`, |
|
1113 |
+ true) |
|
1114 |
+ |
|
1115 |
+ if err != nil { |
|
1116 |
+ t.Fatal(err) |
|
1117 |
+ } |
|
1118 |
+ |
|
1119 |
+ cmd := exec.Command(dockerBinary, "run", "--rm", "testbuildimg", "ls", "-la", "/test") |
|
1120 |
+ out, _, err := runCommandWithOutput(cmd) |
|
1121 |
+ if err != nil { |
|
1122 |
+ t.Fatal(err) |
|
1123 |
+ } |
|
1124 |
+ |
|
1125 |
+ if expected := "drw-------"; !strings.Contains(out, expected) { |
|
1126 |
+ t.Fatalf("expected %s received %s", expected, out) |
|
1127 |
+ } |
|
1128 |
+ |
|
1129 |
+ if expected := "daemon daemon"; !strings.Contains(out, expected) { |
|
1130 |
+ t.Fatalf("expected %s received %s", expected, out) |
|
1131 |
+ } |
|
1132 |
+ |
|
1133 |
+ logDone("build - volume ownership") |
|
1134 |
+} |