From 02e1927cf72aa474d2360f6512d7fb078217a016 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Wed, 31 Jan 2018 17:23:26 +0000 Subject: [PATCH] Remove integration-cli/docker_api_resize_test.go Signed-off-by: Yong Tang Upstream-commit: e8d1f35718b3a9869778611b2cb11c2f4407350f Component: engine --- .../integration-cli/docker_api_resize_test.go | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 components/engine/integration-cli/docker_api_resize_test.go diff --git a/components/engine/integration-cli/docker_api_resize_test.go b/components/engine/integration-cli/docker_api_resize_test.go deleted file mode 100644 index 8ecf540a72..0000000000 --- a/components/engine/integration-cli/docker_api_resize_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package main - -import ( - "context" - "net/http" - "strings" - - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" - "github.com/docker/docker/integration-cli/checker" - "github.com/docker/docker/integration-cli/request" - "github.com/go-check/check" -) - -func (s *DockerSuite) TestResizeAPIResponse(c *check.C) { - out := runSleepingContainer(c, "-d") - cleanedContainerID := strings.TrimSpace(out) - cli, err := client.NewEnvClient() - c.Assert(err, checker.IsNil) - defer cli.Close() - - options := types.ResizeOptions{ - Height: 40, - Width: 40, - } - err = cli.ContainerResize(context.Background(), cleanedContainerID, options) - c.Assert(err, check.IsNil) -} - -func (s *DockerSuite) TestResizeAPIHeightWidthNoInt(c *check.C) { - out := runSleepingContainer(c, "-d") - cleanedContainerID := strings.TrimSpace(out) - - endpoint := "/containers/" + cleanedContainerID + "/resize?h=foo&w=bar" - res, _, err := request.Post(endpoint) - c.Assert(res.StatusCode, check.Equals, http.StatusBadRequest) - c.Assert(err, check.IsNil) -} - -func (s *DockerSuite) TestResizeAPIResponseWhenContainerNotStarted(c *check.C) { - out, _ := dockerCmd(c, "run", "-d", "busybox", "true") - cleanedContainerID := strings.TrimSpace(out) - - // make sure the exited container is not running - dockerCmd(c, "wait", cleanedContainerID) - - cli, err := client.NewEnvClient() - c.Assert(err, checker.IsNil) - defer cli.Close() - - options := types.ResizeOptions{ - Height: 40, - Width: 40, - } - - err = cli.ContainerResize(context.Background(), cleanedContainerID, options) - c.Assert(err.Error(), checker.Contains, "is not running") -}