Example #1
0
 def testConstruct(self):
     self.mox.ReplayAll()
     ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE,
                                       self.TUN_BRIDGE,
                                       '10.0.0.1', self.NET_MAPPING,
                                       'sudo', 2, True)
     self.mox.VerifyAll()
Example #2
0
 def setUp(self):
     self.addCleanup(cfg.CONF.reset)
     # Avoid rpc initialization for unit tests
     cfg.CONF.set_override('rpc_backend',
                           'quantum.openstack.common.rpc.impl_fake')
     kwargs = ovs_quantum_agent.create_agent_config_map(cfg.CONF)
     with mock.patch('quantum.plugins.openvswitch.agent.ovs_quantum_agent.'
                     'OVSQuantumAgent.setup_integration_br',
                     return_value=mock.Mock()):
         with mock.patch('quantum.agent.linux.utils.get_interface_mac',
                         return_value='000000000001'):
             self.agent = ovs_quantum_agent.OVSQuantumAgent(**kwargs)
     self.agent.plugin_rpc = mock.Mock()
     self.agent.context = mock.Mock()
     self.agent.agent_id = mock.Mock()
Example #3
0
    def testProvisionLocalVlanVlan(self):
        action_string = 'mod_vlan_vid:%s,normal' % LS_ID
        self.mock_map_tun_bridge.add_flow(
            priority=4, in_port=self.MAP_TUN_OFPORT,
            dl_vlan=LV_ID, actions=action_string)

        action_string = 'mod_vlan_vid:%s,normal' % LS_ID
        self.mock_int_bridge.add_flow(priority=3, in_port=self.INT_OFPORT,
                                      dl_vlan=LV_ID, actions=action_string)

        self.mox.ReplayAll()
        a = ovs_quantum_agent.OVSQuantumAgent(self.INT_BRIDGE,
                                              self.TUN_BRIDGE,
                                              '10.0.0.1', self.NET_MAPPING,
                                              'sudo', 2, True)
        a.available_local_vlans = set([LV_ID])
        a.phys_brs['net1'] = self.mock_map_tun_bridge
        a.phys_ofports['net1'] = self.MAP_TUN_OFPORT
        a.int_ofports['net1'] = self.INT_OFPORT
        a.provision_local_vlan(NET_UUID, constants.TYPE_VLAN, 'net1', LS_ID)
        self.mox.VerifyAll()