1
0
mirror of https://github.com/moby/moby.git synced 2025-08-01 05:47:11 +03:00

validate log-opt when creating containers

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
Shijiang Wei
2016-02-28 01:38:26 +08:00
parent 3f4e49aa61
commit 7285c9a53a
2 changed files with 14 additions and 0 deletions

View File

@ -440,3 +440,11 @@ func (s *DockerSuite) TestCreateWithWorkdir(c *check.C) {
dockerCmd(c, "create", "--name", name, "-w", dir, "busybox")
dockerCmd(c, "cp", fmt.Sprintf("%s:%s", name, dir), prefix+slash+"tmp")
}
func (s *DockerSuite) TestCreateWithInvalidLogOpts(c *check.C) {
name := "test-invalidate-log-opts"
_, _, err := dockerCmdWithError("create", "--name", name, "--log-opt", "invalid=true")
c.Assert(err, checker.NotNil)
out, _ := dockerCmd(c, "ps", "-a")
c.Assert(out, checker.Not(checker.Contains), name)
}