Fix a panic where RUN [] would be supplied.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe
2015-01-14 16:55:56 -08:00
committed by Tibor Vass
parent 95c0f07966
commit 39343b8618
2 changed files with 26 additions and 3 deletions
+19
View File
@@ -22,6 +22,25 @@ import (
"github.com/docker/docker/pkg/archive"
)
func TestBuildJSONEmptyRun(t *testing.T) {
name := "testbuildjsonemptyrun"
defer deleteImages(name)
_, err := buildImage(
name,
`
FROM busybox
RUN []
`,
true)
if err != nil {
t.Fatal("error when dealing with a RUN statement with empty JSON array")
}
logDone("build - RUN with an empty array should not panic")
}
func TestBuildEmptyWhitespace(t *testing.T) {
name := "testbuildemptywhitespace"
defer deleteImages(name)