Move TestBuildOnBuildForbiddenChainedTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
2629e2ec23
commit
1e0e86360f
2 changed files with 17 additions and 14 deletions
|
@ -1307,3 +1307,20 @@ func TestBuildOnBuild(t *testing.T) {
|
|||
}
|
||||
logDone("build - onbuild")
|
||||
}
|
||||
|
||||
func TestBuildOnBuildForbiddenChained(t *testing.T) {
|
||||
name := "testbuildonbuildforbiddenchained"
|
||||
defer deleteImages(name)
|
||||
_, err := buildImage(name,
|
||||
`FROM busybox
|
||||
ONBUILD ONBUILD RUN touch foobar`,
|
||||
true)
|
||||
if err != nil {
|
||||
if !strings.Contains(err.Error(), "Chaining ONBUILD via `ONBUILD ONBUILD` isn't allowed") {
|
||||
t.Fatalf("Wrong error %v, must be about chaining ONBUILD", err)
|
||||
}
|
||||
} else {
|
||||
t.Fatal("Error must not be nil")
|
||||
}
|
||||
logDone("build - onbuild forbidden chained")
|
||||
}
|
||||
|
|
|
@ -413,20 +413,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
|
|||
return image, err
|
||||
}
|
||||
|
||||
func TestBuildOnBuildForbiddenChainedTrigger(t *testing.T) {
|
||||
_, err := buildImage(testContextTemplate{`
|
||||
from {IMAGE}
|
||||
onbuild onbuild run echo test
|
||||
`,
|
||||
nil, nil,
|
||||
},
|
||||
t, nil, true,
|
||||
)
|
||||
if err == nil {
|
||||
t.Fatal("Error should not be nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildOnBuildForbiddenFromTrigger(t *testing.T) {
|
||||
_, err := buildImage(testContextTemplate{`
|
||||
from {IMAGE}
|
||||
|
|
Loading…
Add table
Reference in a new issue