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

Enhancement of TestDockerNetworkInternalMode

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
This commit is contained in:
Wen Cheng Ma 2016-03-03 16:54:51 +08:00
parent 0eb20be13c
commit 312e20bf6c

View file

@ -1407,7 +1407,7 @@ func (s *DockerSuite) TestDockerNetworkConnectFailsNoInspectChange(c *check.C) {
c.Assert(ns1, check.Equals, ns0) c.Assert(ns1, check.Equals, ns0)
} }
func (s *DockerNetworkSuite) TestDockerNetworkInternalMode(c *check.C) { func (s *DockerSuite) TestDockerNetworkInternalMode(c *check.C) {
dockerCmd(c, "network", "create", "--driver=bridge", "--internal", "internal") dockerCmd(c, "network", "create", "--driver=bridge", "--internal", "internal")
assertNwIsAvailable(c, "internal") assertNwIsAvailable(c, "internal")
nr := getNetworkResource(c, "internal") nr := getNetworkResource(c, "internal")
@ -1417,7 +1417,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkInternalMode(c *check.C) {
c.Assert(waitRun("first"), check.IsNil) c.Assert(waitRun("first"), check.IsNil)
dockerCmd(c, "run", "-d", "--net=internal", "--name=second", "busybox", "top") dockerCmd(c, "run", "-d", "--net=internal", "--name=second", "busybox", "top")
c.Assert(waitRun("second"), check.IsNil) c.Assert(waitRun("second"), check.IsNil)
_, _, err := dockerCmdWithError("exec", "first", "ping", "-c", "1", "www.google.com") _, _, err := dockerCmdWithTimeout(time.Second, "exec", "first", "ping", "-c", "1", "www.google.com")
c.Assert(err, check.NotNil) c.Assert(err, check.NotNil)
_, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "first") _, _, err = dockerCmdWithError("exec", "second", "ping", "-c", "1", "first")
c.Assert(err, check.IsNil) c.Assert(err, check.IsNil)