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

Move relative workdir build test to integration-cli

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
LK4D4 2014-05-25 22:41:47 +04:00 committed by Alexandr Morozov
parent 360fb3d4ea
commit 40630ce4b6
2 changed files with 20 additions and 19 deletions

View file

@ -476,6 +476,26 @@ func TestBuildUser(t *testing.T) {
logDone("build - user")
}
func TestBuildRelativeWorkdir(t *testing.T) {
checkSimpleBuild(t,
`
FROM busybox
RUN [ "$PWD" = '/' ]
WORKDIR test1
RUN [ "$PWD" = '/test1' ]
WORKDIR /test2
RUN [ "$PWD" = '/test2' ]
WORKDIR test3
RUN [ "$PWD" = '/test2/test3' ]
`,
"testbuildimg",
"{{json .config.WorkingDir}}",
`"/test2/test3"`)
deleteImages("testbuildimg")
logDone("build - relative workdir")
}
// TODO: TestCaching
// TODO: TestADDCacheInvalidation

View file

@ -414,25 +414,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
return image, err
}
func TestBuildRelativeWorkdir(t *testing.T) {
img, err := buildImage(testContextTemplate{`
FROM {IMAGE}
RUN [ "$PWD" = '/' ]
WORKDIR test1
RUN [ "$PWD" = '/test1' ]
WORKDIR /test2
RUN [ "$PWD" = '/test2' ]
WORKDIR test3
RUN [ "$PWD" = '/test2/test3' ]
`, nil, nil}, t, nil, true)
if err != nil {
t.Fatal(err)
}
if img.Config.WorkingDir != "/test2/test3" {
t.Fatalf("Expected workdir to be '/test2/test3', received '%s'", img.Config.WorkingDir)
}
}
func TestBuildEnv(t *testing.T) {
img, err := buildImage(testContextTemplate{`
from {IMAGE}