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

Integration test for default bridge init with invalid cluster config

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2015-10-20 19:17:18 -07:00
parent 2de2192c27
commit 37627427a2

View file

@ -16,6 +16,7 @@ import (
"strings"
"time"
"github.com/docker/docker/pkg/integration/checker"
"github.com/docker/libnetwork/iptables"
"github.com/docker/libtrust"
"github.com/go-check/check"
@ -848,6 +849,29 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4ExplicitOutsideContainer
s.d.Restart()
}
func (s *DockerDaemonSuite) TestDaemonDefaultNetworkInvalidClusterConfig(c *check.C) {
testRequires(c, SameHostDaemon)
// Start daemon without docker0 bridge
defaultNetworkBridge := "docker0"
deleteInterface(c, defaultNetworkBridge)
d := NewDaemon(c)
discoveryBackend := "consul://consuladdr:consulport/some/path"
err := d.Start(fmt.Sprintf("--cluster-store=%s", discoveryBackend))
c.Assert(err, checker.IsNil)
// Start daemon with docker0 bridge
ifconfigCmd := exec.Command("ifconfig", defaultNetworkBridge)
_, err = runCommand(ifconfigCmd)
c.Assert(err, check.IsNil)
err = d.Restart(fmt.Sprintf("--cluster-store=%s", discoveryBackend))
c.Assert(err, checker.IsNil)
d.Stop()
}
func (s *DockerDaemonSuite) TestDaemonIP(c *check.C) {
d := s.d