From 6453d49d05a020aef1426c1676d9cc73217c8ff2 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Sat, 10 Feb 2018 00:13:09 +0000 Subject: [PATCH] Remove integration-cli/docker_cli_pause_test.go Signed-off-by: Yong Tang --- integration-cli/docker_cli_pause_test.go | 78 ------------------------ 1 file changed, 78 deletions(-) delete mode 100644 integration-cli/docker_cli_pause_test.go diff --git a/integration-cli/docker_cli_pause_test.go b/integration-cli/docker_cli_pause_test.go deleted file mode 100644 index 682384fc1a..0000000000 --- a/integration-cli/docker_cli_pause_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package main - -import ( - "strings" - "time" - - "github.com/docker/docker/integration-cli/checker" - "github.com/docker/docker/integration-cli/cli" - "github.com/go-check/check" -) - -func (s *DockerSuite) TestPause(c *check.C) { - testRequires(c, IsPausable) - - name := "testeventpause" - runSleepingContainer(c, "-d", "--name", name) - - cli.DockerCmd(c, "pause", name) - pausedContainers := strings.Fields( - cli.DockerCmd(c, "ps", "-f", "status=paused", "-q", "-a").Combined(), - ) - c.Assert(len(pausedContainers), checker.Equals, 1) - - cli.DockerCmd(c, "unpause", name) - - out := cli.DockerCmd(c, "events", "--since=0", "--until", daemonUnixTime(c)).Combined() - events := strings.Split(strings.TrimSpace(out), "\n") - actions := eventActionsByIDAndType(c, events, name, "container") - - c.Assert(actions[len(actions)-2], checker.Equals, "pause") - c.Assert(actions[len(actions)-1], checker.Equals, "unpause") -} - -func (s *DockerSuite) TestPauseMultipleContainers(c *check.C) { - testRequires(c, IsPausable) - - containers := []string{ - "testpausewithmorecontainers1", - "testpausewithmorecontainers2", - } - for _, name := range containers { - runSleepingContainer(c, "-d", "--name", name) - } - cli.DockerCmd(c, append([]string{"pause"}, containers...)...) - pausedContainers := strings.Fields( - cli.DockerCmd(c, "ps", "-f", "status=paused", "-q", "-a").Combined(), - ) - c.Assert(len(pausedContainers), checker.Equals, len(containers)) - - cli.DockerCmd(c, append([]string{"unpause"}, containers...)...) - - out := cli.DockerCmd(c, "events", "--since=0", "--until", daemonUnixTime(c)).Combined() - events := strings.Split(strings.TrimSpace(out), "\n") - - for _, name := range containers { - actions := eventActionsByIDAndType(c, events, name, "container") - - c.Assert(actions[len(actions)-2], checker.Equals, "pause") - c.Assert(actions[len(actions)-1], checker.Equals, "unpause") - } -} - -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, "cannot pause Windows Server Containers") -} - -func (s *DockerSuite) TestStopPausedContainer(c *check.C) { - testRequires(c, DaemonIsLinux) - - id := runSleepingContainer(c) - cli.WaitRun(c, id) - cli.DockerCmd(c, "pause", id) - cli.DockerCmd(c, "stop", id) - cli.WaitForInspectResult(c, id, "{{.State.Running}}", "false", 30*time.Second) -}