Merge pull request #19713 from WeiZhang555/opt-TestEventsContainerFailStartDie

Optimize `TestEventsContainerFailStartDie`
This commit is contained in:
Doug Davis 2016-01-26 09:32:52 -05:00
Родитель 141a301dca 4f7dda3fb2
Коммит e5b5c0ebe8
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -66,12 +66,10 @@ func (s *DockerSuite) TestEventsUntag(c *check.C) {
}
func (s *DockerSuite) TestEventsContainerFailStartDie(c *check.C) {
out, _ := dockerCmd(c, "images", "-q")
image := strings.Split(out, "\n")[0]
_, _, err := dockerCmdWithError("run", "--name", "testeventdie", image, "blerg")
c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not, out=%s", out))
_, _, err := dockerCmdWithError("run", "--name", "testeventdie", "busybox", "blerg")
c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not"))
out, _ = dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
out, _ := dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
events := strings.Split(strings.TrimSpace(out), "\n")
nEvents := len(events)