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

Merge pull request #10844 from ahmetalpbalkan/win-cli/TestBuildDockerfileOutsideContext-path-improvement

integration-cli: pass platform-compatible paths to os.Symlink
This commit is contained in:
Alexander Morozov 2015-02-20 17:19:37 -08:00
commit 5919f1b16c

View file

@ -4688,14 +4688,15 @@ func TestBuildDockerfileOutsideContext(t *testing.T) {
if err := ioutil.WriteFile(filepath.Join(tmpdir, "outsideDockerfile"), []byte("FROM scratch\nENV x y"), 0644); err != nil { if err := ioutil.WriteFile(filepath.Join(tmpdir, "outsideDockerfile"), []byte("FROM scratch\nENV x y"), 0644); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := os.Symlink("../outsideDockerfile", filepath.Join(ctx, "dockerfile1")); err != nil { if err := os.Symlink(filepath.Join("..", "outsideDockerfile"), filepath.Join(ctx, "dockerfile1")); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if err := os.Symlink(filepath.Join(tmpdir, "outsideDockerfile"), filepath.Join(ctx, "dockerfile2")); err != nil { if err := os.Symlink(filepath.Join(tmpdir, "outsideDockerfile"), filepath.Join(ctx, "dockerfile2")); err != nil {
t.Fatal(err) t.Fatal(err)
} }
for _, dockerfilePath := range []string{ for _, dockerfilePath := range []string{
"../outsideDockerfile", filepath.Join("..", "outsideDockerfile"),
filepath.Join(ctx, "dockerfile1"), filepath.Join(ctx, "dockerfile1"),
filepath.Join(ctx, "dockerfile2"), filepath.Join(ctx, "dockerfile2"),
} { } {