mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #23340 from thaJeztah/fix-TestRenameInvalidName
Fix TestRenameInvalidName
This commit is contained in:
commit
a01ae049f9
1 changed files with 6 additions and 2 deletions
|
@ -73,13 +73,17 @@ func (s *DockerSuite) TestRenameInvalidName(c *check.C) {
|
|||
c.Assert(err, checker.NotNil, check.Commentf("Renaming container to invalid name should have failed: %s", out))
|
||||
c.Assert(out, checker.Contains, "Invalid container name", check.Commentf("%v", err))
|
||||
|
||||
out, _, err = dockerCmdWithError("rename", "myname")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Renaming container to invalid name should have failed: %s", out))
|
||||
c.Assert(out, checker.Contains, "requires exactly 2 argument(s).", check.Commentf("%v", err))
|
||||
|
||||
out, _, err = dockerCmdWithError("rename", "myname", "")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Renaming container to invalid name should have failed: %s", out))
|
||||
c.Assert(out, checker.Contains, "\"docker rename\" requires exactly 2 argument(s).", check.Commentf("%v", err))
|
||||
c.Assert(out, checker.Contains, "may be empty", check.Commentf("%v", err))
|
||||
|
||||
out, _, err = dockerCmdWithError("rename", "", "newname")
|
||||
c.Assert(err, checker.NotNil, check.Commentf("Renaming container with empty name should have failed: %s", out))
|
||||
c.Assert(out, checker.Contains, "\"docker rename\" requires exactly 2 argument(s).", check.Commentf("%v", err))
|
||||
c.Assert(out, checker.Contains, "may be empty", check.Commentf("%v", err))
|
||||
|
||||
out, _ = dockerCmd(c, "ps", "-a")
|
||||
c.Assert(out, checker.Contains, "myname", check.Commentf("Output of docker ps should have included 'myname': %s", out))
|
||||
|
|
Loading…
Reference in a new issue