summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTibor Vass <teabee89@gmail.com>2014-05-27 14:49:43 -0700
committerTibor Vass <teabee89@gmail.com>2014-06-18 15:50:39 -0400
commitc4c92e66cdb9fa4c141b4fa4872af37037e1bbe2 (patch)
tree5b802706e4dc00b887a374c5498eb14397f3a2d8
parent7c52ab7f83a7e37f283d4c237111adc18bdf22b4 (diff)
downloaddocker-c4c92e66cdb9fa4c141b4fa4872af37037e1bbe2.tar.gz
add integration test
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
-rw-r--r--integration-cli/docker_cli_run_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go
index e937863a45..3efc0f2b2f 100644
--- a/integration-cli/docker_cli_run_test.go
+++ b/integration-cli/docker_cli_run_test.go
@@ -484,6 +484,36 @@ func TestVolumeWithSymlink(t *testing.T) {
logDone("run - volume with symlink")
}
+// Tests that a volume path that has a symlink exists in a container mounting it with `--volumes-from`.
+func TestVolumesFromSymlinkPath(t *testing.T) {
+ buildCmd := exec.Command(dockerBinary, "build", "-t", "docker-test-volumesfromsymlinkpath", "-")
+ buildCmd.Stdin = strings.NewReader(`FROM busybox
+ RUN mkdir /baz && ln -s /baz /foo
+ VOLUME ["/foo/bar"]`)
+ buildCmd.Dir = workingDirectory
+ err := buildCmd.Run()
+ if err != nil {
+ t.Fatalf("could not build 'docker-test-volumesfromsymlinkpath': %v", err)
+ }
+
+ cmd := exec.Command(dockerBinary, "run", "--name", "test-volumesfromsymlinkpath", "docker-test-volumesfromsymlinkpath")
+ exitCode, err := runCommand(cmd)
+ if err != nil || exitCode != 0 {
+ t.Fatalf("[run] (volume) err: %v, exitcode: %d", err, exitCode)
+ }
+
+ cmd = exec.Command(dockerBinary, "run", "--volumes-from", "test-volumesfromsymlinkpath", "busybox", "sh", "-c", "ls /foo | grep -q bar")
+ exitCode, err = runCommand(cmd)
+ if err != nil || exitCode != 0 {
+ t.Fatalf("[run] err: %v, exitcode: %d", err, exitCode)
+ }
+
+ deleteImages("docker-test-volumesfromsymlinkpath")
+ deleteAllContainers()
+
+ logDone("run - volumes-from symlink path")
+}
+
func TestExitCode(t *testing.T) {
cmd := exec.Command(dockerBinary, "run", "busybox", "/bin/sh", "-c", "exit 72")