Merge pull request #14242 from cpuguy83/add_volume_api

Add volume api
Upstream-commit: fa13f7cde81d1d92c17740efb05823e7f9cc5468
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2015-08-26 21:57:12 +02:00
49 changed files with 1455 additions and 394 deletions
@@ -2776,3 +2776,13 @@ func (s *DockerSuite) TestRunCreateContainerFailedCleanUp(c *check.C) {
containerID, err := inspectField(name, "Id")
c.Assert(containerID, check.Equals, "", check.Commentf("Expected not to have this container: %s!", containerID))
}
func (s *DockerSuite) TestRunNamedVolume(c *check.C) {
dockerCmd(c, "run", "--name=test", "-v", "testing:/foo", "busybox", "sh", "-c", "echo hello > /foo/bar")
out, _ := dockerCmd(c, "run", "--volumes-from", "test", "busybox", "sh", "-c", "cat /foo/bar")
c.Assert(strings.TrimSpace(out), check.Equals, "hello")
out, _ = dockerCmd(c, "run", "-v", "testing:/foo", "busybox", "sh", "-c", "cat /foo/bar")
c.Assert(strings.TrimSpace(out), check.Equals, "hello")
}