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

Add integration test for network host bind option

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
This commit is contained in:
Wen Cheng Ma 2016-02-02 18:01:04 +08:00
parent 5cdc0dfce3
commit 4f1d876e4c

View file

@ -291,6 +291,17 @@ func (s *DockerNetworkSuite) TestDockerNetworkCreatePredefined(c *check.C) {
}
}
func (s *DockerNetworkSuite) TestDockerNetworkCreateHostBind(c *check.C) {
dockerCmd(c, "network", "create", "--subnet=192.168.10.0/24", "--gateway=192.168.10.1", "-o", "com.docker.network.bridge.host_binding_ipv4=192.168.10.1", "testbind")
assertNwIsAvailable(c, "testbind")
out, _ := runSleepingContainer(c, "--net=testbind", "-p", "5000:5000")
id := strings.TrimSpace(out)
c.Assert(waitRun(id), checker.IsNil)
out, _ = dockerCmd(c, "ps")
c.Assert(out, checker.Contains, "192.168.10.1:5000->5000/tcp")
}
func (s *DockerNetworkSuite) TestDockerNetworkRmPredefined(c *check.C) {
predefined := []string{"bridge", "host", "none", "default"}
for _, net := range predefined {