Ejemplo n.º 1
0
 def test_add_linux_bridge_with_vlan(self):
     vlan = objects.Vlan('em1', 5)
     bridge = objects.LinuxBridge('br-ctlplane',
                                  use_dhcp=True,
                                  members=[vlan])
     self.provider.add_vlan(vlan)
     self.provider.add_bridge(bridge)
     self.assertEqual(_VLAN_LINUX_BRIDGE, self.get_vlan_config('vlan5'))
Ejemplo n.º 2
0
 def test_network_linux_bridge_with_dhcp(self):
     interface = objects.Interface('em1')
     bridge = objects.LinuxBridge('br-ctlplane',
                                  use_dhcp=True,
                                  members=[interface])
     self.provider.add_linux_bridge(bridge)
     self.provider.add_interface(interface)
     self.assertEqual(_LINUX_BRIDGE_IFCFG, self.get_interface_config())
     self.assertEqual(_LINUX_BRIDGE_DHCP,
                      self.provider.linuxbridge_data['br-ctlplane'])
Ejemplo n.º 3
0
 def test_network_linux_bridge_static(self):
     v4_addr = objects.Address('192.168.1.2/24')
     interface = objects.Interface('em1')
     bridge = objects.LinuxBridge('br-ctlplane',
                                  members=[interface],
                                  addresses=[v4_addr])
     self.provider.add_interface(interface)
     self.provider.add_bridge(bridge)
     self.assertEqual(_LINUX_BRIDGE_IFCFG, self.get_interface_config())
     self.assertEqual(_LINUX_BRIDGE_STATIC,
                      self.provider.bridge_data['br-ctlplane'])