Ejemplo n.º 1
0
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")
}
Ejemplo n.º 2
0
func (suite *EnvironProviderSuite) TestPrepareSetsAgentName(c *gc.C) {
	attrs := testing.FakeConfig().Merge(testing.Attrs{
		"type":        "maas",
		"maas-oauth":  "aa:bb:cc",
		"maas-server": "http://maas.testing.invalid/maas/",
	})
	config, err := config.New(config.NoDefaults, attrs)
	c.Assert(err, jc.ErrorIsNil)

	config, err = providerInstance.PrepareForCreateEnvironment(config)
	c.Assert(err, jc.ErrorIsNil)

	uuid, ok := config.UnknownAttrs()["maas-agent-name"]
	c.Assert(ok, jc.IsTrue)
	c.Assert(uuid, jc.Satisfies, utils.IsValidUUIDString)
}
Ejemplo n.º 3
0
func (s *configSuite) TestDefaultNetworkBridge(c *gc.C) {
	config := minimalConfig(c)
	unknownAttrs := config.UnknownAttrs()
	c.Assert(unknownAttrs["container"], gc.Equals, "lxc")
	c.Assert(unknownAttrs["network-bridge"], gc.Equals, "lxcbr0")
}