Move TestBuildADDFileNotFound to integration-cli

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 62d97afaf8d328b42c028323f10c3f4782f03561
Component: engine
This commit is contained in:
Alexandr Morozov
2014-06-17 10:35:29 +04:00
parent f7987f5c93
commit fd55280b29
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")
}