Merge pull request #13105 from duglin/FixRunOutput

Fix RUN err msg (again)
This commit is contained in:
Jessie Frazelle 2015-05-12 11:36:55 -07:00
commit 73387bf15a
2 changed files with 3 additions and 3 deletions

View file

@ -623,7 +623,7 @@ func (b *Builder) run(c *daemon.Container) error {
// Wait for it to finish
if ret, _ := c.WaitStop(-1 * time.Second); ret != 0 {
return &jsonmessage.JSONError{
Message: fmt.Sprintf("The command %q returned a non-zero code: %d", b.Config.Cmd.ToString(), ret),
Message: fmt.Sprintf("The command '%s' returned a non-zero code: %d", b.Config.Cmd.ToString(), ret),
Code: ret,
}
}

View file

@ -5416,12 +5416,12 @@ func (s *DockerSuite) TestBuildRUNErrMsg(c *check.C) {
name := "testbuildbadrunerrmsg"
_, out, err := buildImageWithOut(name, `
FROM busybox
RUN badEXE a1 a2`, false)
RUN badEXE a1 \& a2 a3`, false) // tab between a2 and a3
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"`
exp := "The command '/bin/sh -c badEXE a1 \\\\& a2\\ta3' 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)
}