diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go index 3747adaa55..2e2148ca04 100644 --- a/integration-cli/docker_api_containers_test.go +++ b/integration-cli/docker_api_containers_test.go @@ -13,7 +13,6 @@ import ( "path/filepath" "regexp" "runtime" - "strconv" "strings" "time" @@ -98,45 +97,6 @@ func (s *DockerSuite) TestContainerAPIGetJSONNoFieldsOmitted(c *check.C) { } } -type containerPs struct { - Names []string - Ports []types.Port -} - -// regression test for non-empty fields from #13901 -func (s *DockerSuite) TestContainerAPIPsOmitFields(c *check.C) { - // Problematic for Windows porting due to networking not yet being passed back - testRequires(c, DaemonIsLinux) - name := "pstest" - port := 80 - runSleepingContainer(c, "--name", name, "--expose", strconv.Itoa(port)) - - cli, err := client.NewClientWithOpts(client.FromEnv) - assert.NilError(c, err) - defer cli.Close() - - options := types.ContainerListOptions{ - All: true, - } - containers, err := cli.ContainerList(context.Background(), options) - assert.NilError(c, err) - var foundContainer containerPs - for _, c := range containers { - for _, testName := range c.Names { - if "/"+name == testName { - foundContainer.Names = c.Names - foundContainer.Ports = c.Ports - break - } - } - } - - c.Assert(foundContainer.Ports, checker.HasLen, 1) - c.Assert(foundContainer.Ports[0].PrivatePort, checker.Equals, uint16(port)) - c.Assert(foundContainer.Ports[0].PublicPort, checker.NotNil) - c.Assert(foundContainer.Ports[0].IP, checker.NotNil) -} - func (s *DockerSuite) TestContainerAPIGetExport(c *check.C) { // Not supported on Windows as Windows does not support docker export testRequires(c, DaemonIsLinux) diff --git a/integration-cli/docker_cli_create_test.go b/integration-cli/docker_cli_create_test.go index 2b1681d32b..e861b58f0b 100644 --- a/integration-cli/docker_cli_create_test.go +++ b/integration-cli/docker_cli_create_test.go @@ -101,7 +101,7 @@ func (s *DockerSuite) TestCreateHostConfig(c *check.C) { cont := containers[0] c.Assert(cont.HostConfig, check.NotNil, check.Commentf("Expected HostConfig, got none")) - c.Assert(cont.HostConfig.PublishAllPorts, check.NotNil, check.Commentf("Expected PublishAllPorts, got false")) + c.Assert(cont.HostConfig.PublishAllPorts, checker.True, check.Commentf("Expected PublishAllPorts, got false")) } func (s *DockerSuite) TestCreateWithPortRange(c *check.C) { diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index cbc953e581..1857cf603d 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -555,7 +555,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *check.C) { // inspect the network to make sure container is connected nr = getNetworkResource(c, nr.ID) c.Assert(len(nr.Containers), checker.Equals, 1) - c.Assert(nr.Containers[containerID], check.NotNil) // check if container IP matches network inspect ip, _, err := net.ParseCIDR(nr.Containers[containerID].IPv4Address) @@ -699,8 +698,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkInspectDefault(c *check.C) { c.Assert(nr.EnableIPv6, checker.Equals, false) c.Assert(nr.IPAM.Driver, checker.Equals, "default") c.Assert(len(nr.IPAM.Config), checker.Equals, 1) - c.Assert(nr.IPAM.Config[0].Subnet, checker.NotNil) - c.Assert(nr.IPAM.Config[0].Gateway, checker.NotNil) } func (s *DockerNetworkSuite) TestDockerNetworkInspectCustomUnspecified(c *check.C) { @@ -715,8 +712,6 @@ func (s *DockerNetworkSuite) TestDockerNetworkInspectCustomUnspecified(c *check. c.Assert(nr.EnableIPv6, checker.Equals, false) c.Assert(nr.IPAM.Driver, checker.Equals, "default") c.Assert(len(nr.IPAM.Config), checker.Equals, 1) - c.Assert(nr.IPAM.Config[0].Subnet, checker.NotNil) - c.Assert(nr.IPAM.Config[0].Gateway, checker.NotNil) dockerCmd(c, "network", "rm", "test01") assertNwNotAvailable(c, "test01")