mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Merge pull request #12999 from duglin/BadRUNerrMsg
Fix RUN's error msg when it fails
This commit is contained in:
@@ -5384,3 +5384,20 @@ func (s *DockerSuite) TestBuildBadCmdFlag(c *check.C) {
|
||||
c.Fatalf("Bad output\nGot:%s\n\nExpected to contain:%s\n", out, exp)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestBuildRUNErrMsg(c *check.C) {
|
||||
// Test to make sure the bad command is quoted with just "s and
|
||||
// not as a Go []string
|
||||
name := "testbuildbadrunerrmsg"
|
||||
_, out, err := buildImageWithOut(name, `
|
||||
FROM busybox
|
||||
RUN badEXE a1 a2`, false)
|
||||
if err == nil {
|
||||
c.Fatal("Should have failed to build")
|
||||
}
|
||||
|
||||
exp := `The command \"/bin/sh -c badEXE a1 a2\" returned a non-zero code: 127"`
|
||||
if !strings.Contains(out, exp) {
|
||||
c.Fatalf("RUN doesn't have the correct output:\nGot:%s\nExpected:%s", out, exp)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user