Browse code

Add integration test for volumes-from as file Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)

Michael Crosby authored on 2014/04/01 02:41:40
Showing 1 changed files
... ...
@@ -253,3 +253,21 @@ func TestDockerRunWithoutNetworking(t *testing.T) {
253 253
 	logDone("run - disable networking with --networking=false")
254 254
 	logDone("run - disable networking with -n=false")
255 255
 }
256
+
257
+// Regression test for #4741
258
+func TestDockerRunWithVolumesAsFiles(t *testing.T) {
259
+	runCmd := exec.Command(dockerBinary, "run", "--name", "test-data", "--volume", "/etc/hosts:/target-file", "busybox", "true")
260
+	out, stderr, exitCode, err := runCommandWithStdoutStderr(runCmd)
261
+	if err != nil && exitCode != 0 {
262
+		t.Fatal("1", out, stderr, err)
263
+	}
264
+
265
+	runCmd = exec.Command(dockerBinary, "run", "--volumes-from", "test-data", "busybox", "cat", "/target-file")
266
+	out, stderr, exitCode, err = runCommandWithStdoutStderr(runCmd)
267
+	if err != nil && exitCode != 0 {
268
+		t.Fatal("2", out, stderr, err)
269
+	}
270
+	deleteAllContainers()
271
+
272
+	logDone("run - regression test for #4741 - volumes from as files")
273
+}