|
@@ -1067,6 +1067,7 @@ func TestBuildADDLocalAndRemoteFilesWithCache(t *testing.T) {
|
|
logDone("build - add local and remote file with cache")
|
|
logDone("build - add local and remote file with cache")
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// TODO: TestCaching
|
|
func TestBuildADDLocalAndRemoteFilesWithoutCache(t *testing.T) {
|
|
func TestBuildADDLocalAndRemoteFilesWithoutCache(t *testing.T) {
|
|
name := "testbuildaddlocalandremotefilewithoutcache"
|
|
name := "testbuildaddlocalandremotefilewithoutcache"
|
|
defer deleteImages(name)
|
|
defer deleteImages(name)
|
|
@@ -1101,3 +1102,34 @@ func TestBuildADDLocalAndRemoteFilesWithoutCache(t *testing.T) {
|
|
}
|
|
}
|
|
logDone("build - add local and remote file without cache")
|
|
logDone("build - add local and remote file without cache")
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func TestBuildWithVolumeOwnership(t *testing.T) {
|
|
|
|
+ name := "testbuildimg"
|
|
|
|
+ defer deleteImages(name)
|
|
|
|
+
|
|
|
|
+ _, err := buildImage(name,
|
|
|
|
+ `FROM busybox:latest
|
|
|
|
+ RUN mkdir /test && chown daemon:daemon /test && chmod 0600 /test
|
|
|
|
+ VOLUME /test`,
|
|
|
|
+ true)
|
|
|
|
+
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ cmd := exec.Command(dockerBinary, "run", "--rm", "testbuildimg", "ls", "-la", "/test")
|
|
|
|
+ out, _, err := runCommandWithOutput(cmd)
|
|
|
|
+ if err != nil {
|
|
|
|
+ t.Fatal(err)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if expected := "drw-------"; !strings.Contains(out, expected) {
|
|
|
|
+ t.Fatalf("expected %s received %s", expected, out)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if expected := "daemon daemon"; !strings.Contains(out, expected) {
|
|
|
|
+ t.Fatalf("expected %s received %s", expected, out)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ logDone("build - volume ownership")
|
|
|
|
+}
|