From 2629e2ec236a377973e7be296013e366b4074d44 Mon Sep 17 00:00:00 2001 From: Alexandr Morozov Date: Tue, 17 Jun 2014 11:14:45 +0400 Subject: [PATCH] Move TestBuildOnBuildTrigger to integration-cli Docker-DCO-1.1-Signed-off-by: Alexandr Morozov (github: LK4D4) --- integration-cli/docker_cli_build_test.go | 20 ++++++++++++++++++++ integration/buildfile_test.go | 16 ---------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index bebb691bd2..48ac7e5861 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -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") +} diff --git a/integration/buildfile_test.go b/integration/buildfile_test.go index 231aa9975f..7b8fd7b178 100644 --- a/integration/buildfile_test.go +++ b/integration/buildfile_test.go @@ -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}