Move TestBuildOnBuildTrigger to integration-cli

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
Alexandr Morozov 2014-06-17 11:14:45 +04:00
parent 08a10f936b
commit 2629e2ec23
2 changed files with 20 additions and 16 deletions

View File

@ -1287,3 +1287,23 @@ func TestBuildFailsDockerfileEmpty(t *testing.T) {
}
logDone("build - fails with empty dockerfile")
}
func TestBuildOnBuild(t *testing.T) {
name := "testbuildonbuild"
defer deleteImages(name)
_, err := buildImage(name,
`FROM busybox
ONBUILD RUN touch foobar`,
true)
if err != nil {
t.Fatal(err)
}
_, err = buildImage(name,
fmt.Sprintf(`FROM %s
RUN [ -f foobar ]`, name),
true)
if err != nil {
t.Fatal(err)
}
logDone("build - onbuild")
}

View File

@ -413,22 +413,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
return image, err
}
func TestBuildOnBuildTrigger(t *testing.T) {
_, err := buildImage(testContextTemplate{`
from {IMAGE}
onbuild run echo here is the trigger
onbuild run touch foobar
`,
nil, nil,
},
t, nil, true,
)
if err != nil {
t.Fatal(err)
}
// FIXME: test that the 'foobar' file was created in the final build.
}
func TestBuildOnBuildForbiddenChainedTrigger(t *testing.T) {
_, err := buildImage(testContextTemplate{`
from {IMAGE}