mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Implement Pause Resume support for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
parent
a7db0a8402
commit
69985e85d3
11 changed files with 121 additions and 33 deletions
|
|
@ -8,11 +8,11 @@ import (
|
|||
)
|
||||
|
||||
func (s *DockerSuite) TestPause(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
testRequires(c, IsPausable)
|
||||
defer unpauseAllContainers()
|
||||
|
||||
name := "testeventpause"
|
||||
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
|
||||
runSleepingContainer(c, "-d", "--name", name)
|
||||
|
||||
dockerCmd(c, "pause", name)
|
||||
pausedContainers, err := getSliceOfPausedContainers()
|
||||
|
|
@ -30,7 +30,7 @@ func (s *DockerSuite) TestPause(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux)
|
||||
testRequires(c, IsPausable)
|
||||
defer unpauseAllContainers()
|
||||
|
||||
containers := []string{
|
||||
|
|
@ -38,7 +38,7 @@ func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
|||
"testpausewithmorecontainers2",
|
||||
}
|
||||
for _, name := range containers {
|
||||
dockerCmd(c, "run", "-d", "--name", name, "busybox", "top")
|
||||
runSleepingContainer(c, "-d", "--name", name)
|
||||
}
|
||||
dockerCmd(c, append([]string{"pause"}, containers...)...)
|
||||
pausedContainers, err := getSliceOfPausedContainers()
|
||||
|
|
@ -58,9 +58,9 @@ func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) {
|
|||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestPauseFailsOnWindows(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows)
|
||||
dockerCmd(c, "run", "-d", "--name=test", "busybox", "sleep 3")
|
||||
func (s *DockerSuite) TestPauseFailsOnWindowsServerContainers(c *check.C) {
|
||||
testRequires(c, DaemonIsWindows, NotPausable)
|
||||
runSleepingContainer(c, "-d", "--name=test")
|
||||
out, _, _ := dockerCmdWithError("pause", "test")
|
||||
c.Assert(out, checker.Contains, "Windows: Containers cannot be paused")
|
||||
c.Assert(out, checker.Contains, "cannot pause Windows Server Containers")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue