Fix network with -b none

* Don't AllocateNetwork when network is disabled
* Don't createNetwork in execdriver when network is disabled

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3cb14df68c1a59981907fec3bccab80a1d0dda59
Component: engine
This commit is contained in:
Alexander Morozov
2015-05-24 08:26:59 -07:00
parent 710f67f354
commit 7623ba5e39
3 changed files with 25 additions and 10 deletions
@@ -1156,3 +1156,12 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterCrash(c *check.C) {
c.Assert(err, check.IsNil, check.Commentf("Output: %s", mountOut))
c.Assert(strings.Contains(string(mountOut), id), check.Equals, false, check.Commentf("Something mounted from older daemon start: %s", mountOut))
}
func (s *DockerDaemonSuite) TestRunContainerWithBridgeNone(c *check.C) {
c.Assert(s.d.StartWithBusybox("-b", "none"), check.IsNil)
out, err := s.d.Cmd("run", "--rm", "busybox", "ip", "l")
c.Assert(err, check.IsNil, check.Commentf("Output: %s", out))
c.Assert(strings.Contains(out, "eth0"), check.Equals, false,
check.Commentf("There shouldn't be eth0 in container when network is disabled: %s", out))
}