示例#1
0
文件: lxd_test.go 项目: makyo/juju
func (t *LxdSuite) TestNICPropertiesWithoutMACAddressOrMTUGreaterThanZero(c *gc.C) {
	props, err := lxd.NICProperties("testbr1", "eth1", "", 0)
	c.Assert(err, gc.IsNil)
	c.Assert(props, gc.HasLen, 3)
	c.Assert(props[0], gc.Equals, "nictype=bridged")
	c.Assert(props[1], gc.Equals, "parent=testbr1")
	c.Assert(props[2], gc.Equals, "name=eth1")
}
示例#2
0
文件: lxd_test.go 项目: makyo/juju
func (t *LxdSuite) TestNICPropertiesWithMACAddressButNoMTU(c *gc.C) {
	props, err := lxd.NICProperties("testbr1", "eth1", "aa:bb:cc:dd:ee:f0", 0)
	c.Assert(err, gc.IsNil)
	c.Assert(props, gc.HasLen, 4)
	c.Assert(props[0], gc.Equals, "nictype=bridged")
	c.Assert(props[1], gc.Equals, "parent=testbr1")
	c.Assert(props[2], gc.Equals, "name=eth1")
	c.Assert(props[3], gc.Equals, "hwaddr=aa:bb:cc:dd:ee:f0")
}
示例#3
0
文件: lxd_test.go 项目: makyo/juju
func (t *LxdSuite) TestNICPropertiesWithMACAddressAndMTUGreaterThanZero(c *gc.C) {
	props, err := lxd.NICProperties("testbr1", "eth1", "aa:bb:cc:dd:ee:f0", 1066)
	c.Assert(err, gc.IsNil)
	c.Assert(props, gc.HasLen, 5)
	c.Assert(props[0], gc.Equals, "nictype=bridged")
	c.Assert(props[1], gc.Equals, "parent=testbr1")
	c.Assert(props[2], gc.Equals, "name=eth1")
	c.Assert(props[3], gc.Equals, "hwaddr=aa:bb:cc:dd:ee:f0")
	c.Assert(props[4], gc.Equals, "mtu=1066")
}
示例#4
0
文件: lxd_test.go 项目: makyo/juju
func (t *LxdSuite) TestNICPropertiesWithInvalidParentDevice(c *gc.C) {
	props, err := lxd.NICProperties("", "eth1", "", 0)
	c.Assert(props, gc.IsNil)
	c.Assert(err.Error(), gc.Equals, "invalid parent device")
}
示例#5
0
文件: lxd_test.go 项目: makyo/juju
func (t *LxdSuite) TestNICPropertiesWithInvalidDeviceName(c *gc.C) {
	props, err := lxd.NICProperties("testbr1", "", "", 0)
	c.Assert(props, gc.IsNil)
	c.Assert(err.Error(), gc.Equals, "invalid device name")
}