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:
@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user