mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Integration test: bridge ip is excluded from the allocator pool
Signed-off-by: Federico Gimenez <fgimenez@coit.es>
This commit is contained in:
parent
c10ef20ed8
commit
e8da75d4a1
1 changed files with 27 additions and 0 deletions
|
@ -1804,3 +1804,30 @@ func (s *DockerDaemonSuite) TestDaemonStartWithDefalutTlsHost(c *check.C) {
|
|||
c.Fatalf("docker version should return information of server side")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TestBridgeIPIsExcludedFromAllocatorPool(c *check.C) {
|
||||
defaultNetworkBridge := "docker0"
|
||||
deleteInterface(c, defaultNetworkBridge)
|
||||
|
||||
bridgeIP := "192.169.1.1"
|
||||
bridgeRange := bridgeIP + "/30"
|
||||
|
||||
err := s.d.StartWithBusybox("--bip", bridgeRange)
|
||||
c.Assert(err, check.IsNil)
|
||||
defer s.d.Restart()
|
||||
|
||||
var cont int
|
||||
for {
|
||||
contName := fmt.Sprintf("container%d", cont)
|
||||
_, err = s.d.Cmd("run", "--name", contName, "-d", "busybox", "/bin/sleep", "2")
|
||||
if err != nil {
|
||||
// pool exhausted
|
||||
break
|
||||
}
|
||||
ip, err := s.d.Cmd("inspect", "--format", "'{{.NetworkSettings.IPAddress}}'", contName)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
c.Assert(ip, check.Not(check.Equals), bridgeIP)
|
||||
cont++
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue