1
0
mirror of https://github.com/moby/moby.git synced 2025-07-29 07:21:35 +03:00

Move TestBuildADDFileNotFound to integration-cli

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
Alexandr Morozov
2014-06-17 10:35:29 +04:00
parent 686786f107
commit 62d97afaf8
2 changed files with 20 additions and 46 deletions

View File

@ -1195,3 +1195,23 @@ func TestBuldForbiddenContextPath(t *testing.T) {
}
logDone("build - forbidden context path")
}
func TestBuildADDFileNotFound(t *testing.T) {
name := "testbuildaddnotfound"
defer deleteImages(name)
ctx, err := fakeContext(`FROM scratch
ADD foo /usr/local/bar`,
map[string]string{"bar": "hello"})
defer ctx.Close()
if err != nil {
t.Fatal(err)
}
if _, err := buildImageFromContext(name, ctx, true); err != nil {
if !strings.Contains(err.Error(), "foo: no such file or directory") {
t.Fatalf("Wrong error %v, must be about missing foo file or directory", err)
}
} else {
t.Fatal("Error must not be nil")
}
logDone("build - add file not found")
}