mirror of
https://github.com/moby/moby.git
synced 2025-12-07 19:42:23 +03:00
Fix a parser error where an empty RUN statement would cause a panic
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
@@ -22,6 +22,27 @@ import (
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
)
|
||||
|
||||
func TestBuildEmptyWhitespace(t *testing.T) {
|
||||
name := "testbuildemptywhitespace"
|
||||
defer deleteImages(name)
|
||||
|
||||
_, err := buildImage(
|
||||
name,
|
||||
`
|
||||
FROM busybox
|
||||
RUN
|
||||
quux \
|
||||
bar
|
||||
`,
|
||||
true)
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("no error when dealing with a RUN statement with no content on the same line")
|
||||
}
|
||||
|
||||
logDone("build - statements with whitespace and no content should generate a parse error")
|
||||
}
|
||||
|
||||
func TestBuildShCmdJSONEntrypoint(t *testing.T) {
|
||||
name := "testbuildshcmdjsonentrypoint"
|
||||
defer deleteImages(name)
|
||||
|
||||
Reference in New Issue
Block a user