Windows: Go1.11: Use long path names in build context (TestBuildSymlinkBreakout)

Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit b1b9937bc75f0db9c804838ecce9bb6792a42525)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 533b0f602d10af8fe325c3544a2411f5060a47b8
Component: engine
This commit is contained in:
John Howard
2019-04-17 23:09:04 +02:00
committed by Sebastiaan van Stijn
parent 407b652dce
commit 00a7935f14
3 changed files with 40 additions and 0 deletions
@@ -24,6 +24,7 @@ import (
"github.com/docker/docker/internal/test/fakestorage"
"github.com/docker/docker/internal/testutil"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/system"
"github.com/go-check/check"
"github.com/moby/buildkit/frontend/dockerfile/command"
"github.com/opencontainers/go-digest"
@@ -3598,6 +3599,11 @@ func (s *DockerSuite) TestBuildSymlinkBreakout(c *check.C) {
name := "testbuildsymlinkbreakout"
tmpdir, err := ioutil.TempDir("", name)
c.Assert(err, check.IsNil)
// See https://github.com/moby/moby/pull/37770 for reason for next line.
tmpdir, err = system.GetLongPathName(tmpdir)
c.Assert(err, check.IsNil)
defer os.RemoveAll(tmpdir)
ctx := filepath.Join(tmpdir, "context")
if err := os.MkdirAll(ctx, 0755); err != nil {