1
0
mirror of https://github.com/moby/moby.git synced 2025-08-01 05:47:11 +03: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

@ -5,7 +5,6 @@ package main
import (
"bufio"
"fmt"
"net/http"
"os"
"os/exec"
"reflect"
@ -15,12 +14,13 @@ import (
"sync"
"time"
"github.com/docker/docker/client"
"github.com/docker/docker/integration-cli/checker"
"github.com/docker/docker/integration-cli/cli"
"github.com/docker/docker/integration-cli/cli/build"
"github.com/docker/docker/integration-cli/request"
icmd "github.com/docker/docker/pkg/testutil/cmd"
"github.com/go-check/check"
"golang.org/x/net/context"
)
func (s *DockerSuite) TestExec(c *check.C) {
@ -357,16 +357,21 @@ func (s *DockerSuite) TestExecInspectID(c *check.C) {
}
// But we should still be able to query the execID
sc, body, _ := request.SockRequest("GET", "/exec/"+execID+"/json", nil, daemonHost())
cli, err := client.NewEnvClient()
c.Assert(err, checker.IsNil)
defer cli.Close()
c.Assert(sc, checker.Equals, http.StatusOK, check.Commentf("received status != 200 OK: %d\n%s", sc, body))
_, err = cli.ContainerExecInspect(context.Background(), execID)
c.Assert(err, checker.IsNil)
// Now delete the container and then an 'inspect' on the exec should
// result in a 404 (not 'container not running')
out, ec := dockerCmd(c, "rm", "-f", id)
c.Assert(ec, checker.Equals, 0, check.Commentf("error removing container: %s", out))
sc, body, _ = request.SockRequest("GET", "/exec/"+execID+"/json", nil, daemonHost())
c.Assert(sc, checker.Equals, http.StatusNotFound, check.Commentf("received status != 404: %d\n%s", sc, body))
_, err = cli.ContainerExecInspect(context.Background(), execID)
expected := "No such exec instance"
c.Assert(err.Error(), checker.Contains, expected)
}
func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {