mirror of
https://github.com/moby/moby.git
synced 2025-08-01 05:47:11 +03:00
Move TestBuildFails to integration-cli
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
@ -1256,3 +1256,20 @@ func TestBuildInheritance(t *testing.T) {
|
||||
}
|
||||
logDone("build - inheritance")
|
||||
}
|
||||
|
||||
func TestBuildFails(t *testing.T) {
|
||||
name := "testbuildfails"
|
||||
defer deleteImages(name)
|
||||
_, err := buildImage(name,
|
||||
`FROM busybox
|
||||
RUN sh -c "exit 23"`,
|
||||
true)
|
||||
if err != nil {
|
||||
if !strings.Contains(err.Error(), "returned a non-zero code: 23") {
|
||||
t.Fatalf("Wrong error %v, must be about non-zero code 23", err)
|
||||
}
|
||||
} else {
|
||||
t.Fatal("Error must not be nil")
|
||||
}
|
||||
logDone("build - fails")
|
||||
}
|
||||
|
Reference in New Issue
Block a user