1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

move entrypoint integration-cli test for blank entrypoint to separate function

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe 2014-09-03 12:17:17 -07:00
parent 92f885d7bd
commit 576416c99a

View file

@ -773,13 +773,14 @@ func TestBuildExpose(t *testing.T) {
logDone("build - expose") logDone("build - expose")
} }
func TestBuildEntrypoint(t *testing.T) { func TestBuildEmptyEntrypoint(t *testing.T) {
name := "testbuildentrypoint" name := "testbuildentrypoint"
expected := "[/bin/echo]"
defer deleteImages(name) defer deleteImages(name)
expected := "[]"
_, err := buildImage(name, _, err := buildImage(name,
`FROM scratch `FROM busybox
ENTRYPOINT ["/bin/echo"]`, ENTRYPOINT []`,
true) true)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -792,17 +793,21 @@ func TestBuildEntrypoint(t *testing.T) {
t.Fatalf("Entrypoint %s, expected %s", res, expected) t.Fatalf("Entrypoint %s, expected %s", res, expected)
} }
deleteImages(name) logDone("build - empty entrypoint")
expected = "[]" }
_, err = buildImage(name, func TestBuildEntrypoint(t *testing.T) {
`FROM busybox name := "testbuildentrypoint"
ENTRYPOINT []`, expected := "[/bin/echo]"
defer deleteImages(name)
_, err := buildImage(name,
`FROM scratch
ENTRYPOINT ["/bin/echo"]`,
true) true)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
res, err = inspectField(name, "Config.Entrypoint") res, err := inspectField(name, "Config.Entrypoint")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }