1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Stop using deprecated SockRequest

Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
This commit is contained in:
Stanislav Bondarenko 2017-05-23 23:56:26 -04:00
parent cdf870bd0b
commit 0fd5a65428
32 changed files with 1399 additions and 1165 deletions

View file

@ -4,12 +4,12 @@ package main
import (
"encoding/json"
"fmt"
"net/http"
"github.com/docker/docker/client"
"github.com/docker/docker/integration-cli/checker"
"github.com/docker/docker/integration-cli/request"
"github.com/go-check/check"
"golang.org/x/net/context"
)
// #16665
@ -19,9 +19,11 @@ func (s *DockerSuite) TestInspectAPICpusetInConfigPre120(c *check.C) {
name := "cpusetinconfig-pre120"
dockerCmd(c, "run", "--name", name, "--cpuset-cpus", "0", "busybox", "true")
status, body, err := request.SockRequest("GET", fmt.Sprintf("/v1.19/containers/%s/json", name), nil, daemonHost())
c.Assert(status, check.Equals, http.StatusOK)
var httpClient *http.Client
cli, err := client.NewClient(daemonHost(), "v1.19", httpClient, nil)
c.Assert(err, checker.IsNil)
defer cli.Close()
_, body, err := cli.ContainerInspectWithRaw(context.Background(), name, false)
c.Assert(err, check.IsNil)
var inspectJSON map[string]interface{}