mirror of
https://github.com/moby/moby.git
synced 2025-11-30 07:21:52 +03:00
Use suite for integration-cli
It prints test name and duration for each test. Also performs deleteAllContainers after each test. Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
@@ -4,26 +4,24 @@ import (
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/go-check/check"
|
||||
)
|
||||
|
||||
func TestExecResizeApiHeightWidthNoInt(t *testing.T) {
|
||||
func (s *DockerSuite) TestExecResizeApiHeightWidthNoInt(c *check.C) {
|
||||
runCmd := exec.Command(dockerBinary, "run", "-d", "busybox", "top")
|
||||
out, _, err := runCommandWithOutput(runCmd)
|
||||
if err != nil {
|
||||
t.Fatalf(out, err)
|
||||
c.Fatalf(out, err)
|
||||
}
|
||||
defer deleteAllContainers()
|
||||
cleanedContainerID := strings.TrimSpace(out)
|
||||
|
||||
endpoint := "/exec/" + cleanedContainerID + "/resize?h=foo&w=bar"
|
||||
status, _, err := sockRequest("POST", endpoint, nil)
|
||||
if err == nil {
|
||||
t.Fatal("Expected exec resize Request to fail")
|
||||
c.Fatal("Expected exec resize Request to fail")
|
||||
}
|
||||
if status != http.StatusInternalServerError {
|
||||
t.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
|
||||
c.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
|
||||
}
|
||||
|
||||
logDone("container exec resize - height, width no int fail")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user