Move TestBuildAddToSymlinkDest to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
690711b584
commit
cc42eeac21
2 changed files with 23 additions and 18 deletions
|
@ -1358,3 +1358,26 @@ func TestBuildOnBuildForbiddenMaintainer(t *testing.T) {
|
|||
}
|
||||
logDone("build - onbuild forbidden maintainer")
|
||||
}
|
||||
|
||||
// gh #2446
|
||||
func TestBuildAddToSymlinkDest(t *testing.T) {
|
||||
name := "testbuildaddtosymlinkdest"
|
||||
defer deleteImages(name)
|
||||
ctx, err := fakeContext(`FROM busybox
|
||||
RUN mkdir /foo
|
||||
RUN ln -s /foo /bar
|
||||
ADD foo /bar/
|
||||
RUN [ -f /bar/foo ]
|
||||
RUN [ -f /foo/foo ]`,
|
||||
map[string]string{
|
||||
"foo": "hello",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer ctx.Close()
|
||||
if _, err := buildImageFromContext(name, ctx, true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
logDone("build - add to symlink destination")
|
||||
}
|
||||
|
|
|
@ -412,21 +412,3 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
|
|||
err = json.NewDecoder(buffer).Decode(image)
|
||||
return image, err
|
||||
}
|
||||
|
||||
// gh #2446
|
||||
func TestBuildAddToSymlinkDest(t *testing.T) {
|
||||
eng := NewTestEngine(t)
|
||||
defer nuke(mkDaemonFromEngine(eng, t))
|
||||
|
||||
_, err := buildImage(testContextTemplate{`
|
||||
from {IMAGE}
|
||||
run mkdir /foo
|
||||
run ln -s /foo /bar
|
||||
add foo /bar/
|
||||
run stat /bar/foo
|
||||
`,
|
||||
[][2]string{{"foo", "HEYO"}}, nil}, t, eng, true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue