Browse code

Merge pull request #19713 from WeiZhang555/opt-TestEventsContainerFailStartDie

Optimize `TestEventsContainerFailStartDie`

Doug Davis authored on 2016/01/26 23:32:52
Showing 1 changed files
... ...
@@ -66,12 +66,10 @@ func (s *DockerSuite) TestEventsUntag(c *check.C) {
66 66
 }
67 67
 
68 68
 func (s *DockerSuite) TestEventsContainerFailStartDie(c *check.C) {
69
-	out, _ := dockerCmd(c, "images", "-q")
70
-	image := strings.Split(out, "\n")[0]
71
-	_, _, err := dockerCmdWithError("run", "--name", "testeventdie", image, "blerg")
72
-	c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not, out=%s", out))
69
+	_, _, err := dockerCmdWithError("run", "--name", "testeventdie", "busybox", "blerg")
70
+	c.Assert(err, checker.NotNil, check.Commentf("Container run with command blerg should have failed, but it did not"))
73 71
 
74
-	out, _ = dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
72
+	out, _ := dockerCmd(c, "events", "--since=0", fmt.Sprintf("--until=%d", daemonTime(c).Unix()))
75 73
 	events := strings.Split(strings.TrimSpace(out), "\n")
76 74
 
77 75
 	nEvents := len(events)