Use busybox in 'pause' tests
Don't assume that any random image will have 'top' and explicitely use the busybox image for testing. Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com> Upstream-commit: 3529e3dac78a18df46d4010a58c9f9d741b42fab Component: engine
This commit is contained in:
@ -11,9 +11,7 @@ func (s *DockerSuite) TestPause(c *check.C) {
|
||||
defer unpauseAllContainers()
|
||||
|
||||
name := "testeventpause"
|
||||
out, _ := dockerCmd(c, "images", "-q")
|
||||
image := strings.Split(out, "\n")[0]
|
||||
dockerCmd(c, "run", "-d", "--name", name, image, "top")
|
||||
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
|
||||
|
||||
dockerCmd(c, "pause", name)
|
||||
pausedContainers, err := getSliceOfPausedContainers()
|
||||
@ -26,7 +24,7 @@ func (s *DockerSuite) TestPause(c *check.C) {
|
||||
|
||||
dockerCmd(c, "unpause", name)
|
||||
|
||||
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(out, "\n")
|
||||
if len(events) <= 1 {
|
||||
c.Fatalf("Missing expected event")
|
||||
@ -51,10 +49,8 @@ func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
||||
"testpausewithmorecontainers1",
|
||||
"testpausewithmorecontainers2",
|
||||
}
|
||||
out, _ := dockerCmd(c, "images", "-q")
|
||||
image := strings.Split(out, "\n")[0]
|
||||
for _, name := range containers {
|
||||
dockerCmd(c, "run", "-d", "--name", name, image, "top")
|
||||
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
|
||||
}
|
||||
dockerCmd(c, append([]string{"pause"}, containers...)...)
|
||||
pausedContainers, err := getSliceOfPausedContainers()
|
||||
@ -67,7 +63,7 @@ func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
||||
|
||||
dockerCmd(c, append([]string{"unpause"}, containers...)...)
|
||||
|
||||
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(out, "\n")
|
||||
if len(events) <= len(containers)*3-2 {
|
||||
c.Fatalf("Missing expected event")
|
||||
|
||||
Reference in New Issue
Block a user