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:
parent
cdf870bd0b
commit
0fd5a65428
32 changed files with 1399 additions and 1165 deletions
|
@ -5,9 +5,11 @@ package main
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"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"
|
||||
)
|
||||
|
||||
func (s *DockerSuite) TestAPIUpdateContainer(c *check.C) {
|
||||
|
@ -16,12 +18,19 @@ func (s *DockerSuite) TestAPIUpdateContainer(c *check.C) {
|
|||
testRequires(c, swapMemorySupport)
|
||||
|
||||
name := "apiUpdateContainer"
|
||||
hostConfig := map[string]interface{}{
|
||||
"Memory": 314572800,
|
||||
"MemorySwap": 524288000,
|
||||
updateConfig := container.UpdateConfig{
|
||||
Resources: container.Resources{
|
||||
Memory: 314572800,
|
||||
MemorySwap: 524288000,
|
||||
},
|
||||
}
|
||||
dockerCmd(c, "run", "-d", "--name", name, "-m", "200M", "busybox", "top")
|
||||
_, _, err := request.SockRequest("POST", "/containers/"+name+"/update", hostConfig, daemonHost())
|
||||
cli, err := client.NewEnvClient()
|
||||
c.Assert(err, check.IsNil)
|
||||
defer cli.Close()
|
||||
|
||||
_, err = cli.ContainerUpdate(context.Background(), name, updateConfig)
|
||||
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
c.Assert(inspectField(c, name, "HostConfig.Memory"), checker.Equals, "314572800")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue