1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Windows: Correct TestVolumesNoCopyData

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-09-06 15:38:19 -07:00
parent 75c36bcc64
commit 8a1fdce7fe

View file

@ -2276,18 +2276,19 @@ func (s *DockerSuite) TestRunCreateVolumeEtc(c *check.C) {
} }
func (s *DockerSuite) TestVolumesNoCopyData(c *check.C) { func (s *DockerSuite) TestVolumesNoCopyData(c *check.C) {
// TODO Windows (Post TP5). Windows does not support volumes which // TODO Windows (Post RS1). Windows does not support volumes which
// are pre-populated such as is built in the dockerfile used in this test. // are pre-populated such as is built in the dockerfile used in this test.
testRequires(c, DaemonIsLinux) testRequires(c, DaemonIsLinux)
prefix, slash := getPrefixAndSlashFromDaemonPlatform()
if _, err := buildImage("dataimage", if _, err := buildImage("dataimage",
`FROM busybox `FROM busybox
RUN mkdir -p /foo RUN ["mkdir", "-p", "/foo"]
RUN touch /foo/bar`, RUN ["touch", "/foo/bar"]`,
true); err != nil { true); err != nil {
c.Fatal(err) c.Fatal(err)
} }
dockerCmd(c, "run", "--name", "test", "-v", "/foo", "busybox") dockerCmd(c, "run", "--name", "test", "-v", prefix+slash+"foo", "busybox")
if out, _, err := dockerCmdWithError("run", "--volumes-from", "test", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") { if out, _, err := dockerCmdWithError("run", "--volumes-from", "test", "dataimage", "ls", "-lh", "/foo/bar"); err == nil || !strings.Contains(out, "No such file or directory") {
c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out) c.Fatalf("Data was copied on volumes-from but shouldn't be:\n%q", out)