docker_api_exec_resize_test.go 577 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "net/http"
  4. "os/exec"
  5. "strings"
  6. "github.com/go-check/check"
  7. )
  8. func (s *DockerSuite) TestExecResizeApiHeightWidthNoInt(c *check.C) {
  9. runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
  10. out, _, err := runCommandWithOutput(runCmd)
  11. if err != nil {
  12. c.Fatalf(out, err)
  13. }
  14. cleanedContainerID := strings.TrimSpace(out)
  15. endpoint := "/exec/" + cleanedContainerID + "/resize?h=foo&w=bar"
  16. status, _, err := sockRequest("POST", endpoint, nil)
  17. c.Assert(status, check.Equals, http.StatusInternalServerError)
  18. c.Assert(err, check.IsNil)
  19. }