예제 #1
0
파일: config_test.go 프로젝트: imoapps/juju
func (s *configSuite) TestDefaultNetworkBridgeForLXCContainers(c *gc.C) {
	testConfig := localConfig(c, map[string]interface{}{
		"container": "lxc",
	})
	containerType, bridgeName := local.ContainerAndBridge(c, testConfig)
	c.Check(containerType, gc.Equals, string(instance.LXC))
	c.Check(bridgeName, gc.Equals, lxc.DefaultLxcBridge)
}
예제 #2
0
파일: config_test.go 프로젝트: imoapps/juju
func (s *configSuite) TestDefaultNetworkBridgeForKVMContainers(c *gc.C) {
	testConfig := localConfig(c, map[string]interface{}{
		"container": "kvm",
	})
	containerType, bridgeName := local.ContainerAndBridge(c, testConfig)
	c.Check(containerType, gc.Equals, string(instance.KVM))
	c.Check(bridgeName, gc.Equals, kvm.DefaultKvmBridge)
}
예제 #3
0
파일: config_test.go 프로젝트: imoapps/juju
func (s *configSuite) TestSetNetworkBridge(c *gc.C) {
	config := localConfig(c, map[string]interface{}{
		"network-bridge": "br0",
	})
	unknownAttrs := config.UnknownAttrs()
	c.Assert(unknownAttrs["network-bridge"], gc.Equals, "br0")
	_, bridgeName := local.ContainerAndBridge(c, config)
	c.Check(bridgeName, gc.Equals, "br0")
}
예제 #4
0
파일: config_test.go 프로젝트: imoapps/juju
func (s *configSuite) TestExplicitNetworkBridgeForKVMContainers(c *gc.C) {
	testConfig := localConfig(c, map[string]interface{}{
		"container":      "kvm",
		"network-bridge": "lxcbr0",
	})
	containerType, bridgeName := local.ContainerAndBridge(c, testConfig)
	c.Check(containerType, gc.Equals, string(instance.KVM))
	c.Check(bridgeName, gc.Equals, "lxcbr0")
}