mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Move TestBuildOnBuildForbiddenFromTrigger to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
1e0e86360f
commit
1c8ec01c55
2 changed files with 17 additions and 14 deletions
|
@ -1324,3 +1324,20 @@ func TestBuildOnBuildForbiddenChained(t *testing.T) {
|
||||||
}
|
}
|
||||||
logDone("build - onbuild forbidden chained")
|
logDone("build - onbuild forbidden chained")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildOnBuildForbiddenFrom(t *testing.T) {
|
||||||
|
name := "testbuildonbuildforbiddenfrom"
|
||||||
|
defer deleteImages(name)
|
||||||
|
_, err := buildImage(name,
|
||||||
|
`FROM busybox
|
||||||
|
ONBUILD FROM scratch`,
|
||||||
|
true)
|
||||||
|
if err != nil {
|
||||||
|
if !strings.Contains(err.Error(), "FROM isn't allowed as an ONBUILD trigger") {
|
||||||
|
t.Fatalf("Wrong error %v, must be about FROM forbidden", err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
t.Fatal("Error must not be nil")
|
||||||
|
}
|
||||||
|
logDone("build - onbuild forbidden from")
|
||||||
|
}
|
||||||
|
|
|
@ -413,20 +413,6 @@ func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u
|
||||||
return image, err
|
return image, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildOnBuildForbiddenFromTrigger(t *testing.T) {
|
|
||||||
_, err := buildImage(testContextTemplate{`
|
|
||||||
from {IMAGE}
|
|
||||||
onbuild from {IMAGE}
|
|
||||||
`,
|
|
||||||
nil, nil,
|
|
||||||
},
|
|
||||||
t, nil, true,
|
|
||||||
)
|
|
||||||
if err == nil {
|
|
||||||
t.Fatal("Error should not be nil")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestBuildOnBuildForbiddenMaintainerTrigger(t *testing.T) {
|
func TestBuildOnBuildForbiddenMaintainerTrigger(t *testing.T) {
|
||||||
_, err := buildImage(testContextTemplate{`
|
_, err := buildImage(testContextTemplate{`
|
||||||
from {IMAGE}
|
from {IMAGE}
|
||||||
|
|
Loading…
Add table
Reference in a new issue