예제 #1
0
    def test_delete_vxlan_bridge_no_int_mappings(self):
        interface_mappings = {}
        with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
                               'get_interface_by_ip',
                               return_value=None):
            lbm = linuxbridge_neutron_agent.LinuxBridgeManager(
                interface_mappings)

        with contextlib.nested(
                mock.patch.object(ip_lib, "device_exists"),
                mock.patch.object(lbm, "get_interfaces_on_bridge"),
                mock.patch.object(lbm, "remove_interface"),
                mock.patch.object(lbm, "delete_vxlan"),
                mock.patch.object(utils,
                                  "execute")) as (de_fn, getif_fn, remif_fn,
                                                  del_vxlan, exec_fn):
            de_fn.return_value = False
            lbm.delete_vlan_bridge("br0")
            self.assertFalse(getif_fn.called)

            de_fn.return_value = True
            getif_fn.return_value = ["vxlan-1002"]
            exec_fn.return_value = False
            lbm.delete_vlan_bridge("br0")
            del_vxlan.assert_called_with("vxlan-1002")
예제 #2
0
    def setUp(self):
        super(TestLinuxBridgeManager, self).setUp()
        self.interface_mappings = {'physnet1': 'eth1'}
        self.root_helper = cfg.CONF.AGENT.root_helper

        self.lbm = linuxbridge_neutron_agent.LinuxBridgeManager(
            self.interface_mappings, self.root_helper)
예제 #3
0
    def setUp(self):
        super(TestLinuxBridge, self).setUp()
        self.addCleanup(cfg.CONF.reset)
        interface_mappings = {'physnet1': 'eth1'}
        root_helper = cfg.CONF.AGENT.root_helper

        self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager(
            interface_mappings, root_helper)
예제 #4
0
    def setUp(self):
        self.skipTest("udev not consistently available in Ubuntu buildds")
        super(TestLinuxBridge, self).setUp()
        interface_mappings = {'physnet1': 'eth1'}
        root_helper = cfg.CONF.AGENT.root_helper

        self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager(
            interface_mappings, root_helper)
예제 #5
0
    def setUp(self):
        super(TestLinuxBridge, self).setUp()
        interface_mappings = {'physnet1': 'eth1'}

        with mock.patch.object(linuxbridge_neutron_agent.LinuxBridgeManager,
                               'get_interface_by_ip',
                               return_value=None):
            self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager(
                interface_mappings)
    def setUp(self):
        super(TestLinuxBridgeManager, self).setUp()
        self.interface_mappings = {'physnet1': 'eth1'}

        with mock.patch.object(ip_lib.IPWrapper,
                               'get_device_by_ip',
                               return_value=None):
            self.lbm = linuxbridge_neutron_agent.LinuxBridgeManager(
                self.interface_mappings)
예제 #7
0
            def __init__(self):
                self.agent_id = 1
                self.br_mgr = (linuxbridge_neutron_agent.LinuxBridgeManager(
                    {'physnet1': 'eth1'}, cfg.CONF.AGENT.root_helper))

                self.br_mgr.vxlan_mode = lconst.VXLAN_UCAST
                segment = mock.Mock()
                segment.network_type = 'vxlan'
                segment.segmentation_id = 1
                self.br_mgr.network_map['net_id'] = segment
            def __init__(self):
                self.agent_id = 1
                with mock.patch.object(ip_lib.IPWrapper,
                                       'get_device_by_ip',
                                       return_value=None):
                    self.br_mgr = (
                        linuxbridge_neutron_agent.LinuxBridgeManager(
                            {'physnet1': 'eth1'}))

                self.br_mgr.vxlan_mode = lconst.VXLAN_UCAST
                segment = mock.Mock()
                segment.network_type = 'vxlan'
                segment.segmentation_id = 1
                self.br_mgr.network_map['net_id'] = segment
    def setUp(self):
        super(TestLinuxBridge, self).setUp()
        interface_mappings = {'physnet1': 'eth1'}

        self.linux_bridge = linuxbridge_neutron_agent.LinuxBridgeManager(
            interface_mappings)