mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
builder: properly communicate onbuild trigger information during
subsequent builds. Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
@@ -2142,3 +2142,25 @@ func TestBuildEmptyCmd(t *testing.T) {
|
||||
}
|
||||
logDone("build - empty cmd")
|
||||
}
|
||||
|
||||
func TestBuildOnBuildOutput(t *testing.T) {
|
||||
name := "testbuildonbuildparent"
|
||||
defer deleteImages(name)
|
||||
if _, err := buildImage(name, "FROM busybox\nONBUILD RUN echo foo\n", true); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
childname := "testbuildonbuildchild"
|
||||
defer deleteImages(childname)
|
||||
|
||||
_, out, err := buildImageWithOut(name, "FROM "+name+"\nMAINTAINER quux\n", true)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if !strings.Contains(out, "Trigger 0, run echo foo") {
|
||||
t.Fatal("failed to find the ONBUILD output")
|
||||
}
|
||||
|
||||
logDone("build - onbuild output")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user