docker_api_exec_resize_test.go 592 B

12345678910111213141516171819202122232425
  1. package main
  2. import (
  3. "os/exec"
  4. "strings"
  5. "testing"
  6. )
  7. func TestExecResizeApiHeightWidthNoInt(t *testing.T) {
  8. runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
  9. out, _, err := runCommandWithOutput(runCmd)
  10. if err != nil {
  11. t.Fatalf(out, err)
  12. }
  13. defer deleteAllContainers()
  14. cleanedContainerID := strings.TrimSpace(out)
  15. endpoint := "/exec/" + cleanedContainerID + "/resize?h=foo&w=bar"
  16. _, err = sockRequest("POST", endpoint, nil)
  17. if err == nil {
  18. t.Fatal("Expected exec resize Request to fail")
  19. }
  20. logDone("container exec resize - height, width no int fail")
  21. }