mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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>
This commit is contained in:
parent
6206cbe193
commit
3529e3dac7
1 changed files with 4 additions and 8 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue