Exemple #1
0
    def testConstruct(self):
        self.mox.ReplayAll()

        b = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                    self.TUN_BRIDGE,
                                                    '10.0.0.1',
                                                    'sudo', 2, 2)
        self.mox.VerifyAll()
Exemple #2
0
 def testPortUnbound(self):
     self.mox.ReplayAll()
     a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                 self.TUN_BRIDGE,
                                                 '10.0.0.1',
                                                 'sudo', 2, 2)
     a.available_local_vlans = set([LV_ID])
     a.local_vlan_map[NET_UUID] = LVM
     a.port_unbound(VIF_PORT, NET_UUID)
     self.mox.VerifyAll()
Exemple #3
0
    def testPortBound(self):
        self.mock_int_bridge.set_db_attribute('Port', VIF_PORT.port_name,
                                              'tag', str(LVM.vlan))
        self.mock_int_bridge.delete_flows(in_port=VIF_PORT.ofport)

        self.mox.ReplayAll()
        a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                    self.TUN_BRIDGE,
                                                    '10.0.0.1',
                                                    'sudo', 2, 2)
        a.local_vlan_map[NET_UUID] = LVM
        a.port_bound(VIF_PORT, NET_UUID, LS_ID)
        self.mox.VerifyAll()
Exemple #4
0
    def testReclaimLocalVlan(self):
        self.mock_tun_bridge.delete_flows(tun_id=LVM.lsw_id)

        self.mock_tun_bridge.delete_flows(dl_vlan=LVM.vlan)

        self.mox.ReplayAll()
        a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                    self.TUN_BRIDGE,
                                                    '10.0.0.1',
                                                    'sudo', 2, 2)
        a.available_local_vlans = set()
        a.local_vlan_map[NET_UUID] = LVM
        a.reclaim_local_vlan(NET_UUID, LVM)
        self.assertTrue(LVM.vlan in a.available_local_vlans)
        self.mox.VerifyAll()
Exemple #5
0
    def testPortDead(self):
        self.mock_int_bridge.set_db_attribute(
            'Port', VIF_PORT.port_name, 'tag', ovs_quantum_agent.DEAD_VLAN_TAG)

        self.mock_int_bridge.add_flow(priority=2, in_port=VIF_PORT.ofport,
                                      actions='drop')

        self.mox.ReplayAll()
        a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                    self.TUN_BRIDGE,
                                                    '10.0.0.1',
                                                    'sudo', 2, 2)
        a.available_local_vlans = set([LV_ID])
        a.local_vlan_map[NET_UUID] = LVM
        a.port_dead(VIF_PORT)
        self.mox.VerifyAll()
Exemple #6
0
    def testProvisionLocalVlan(self):
        action_string = 'strip_vlan,set_tunnel:%s,normal' % LS_ID
        self.mock_tun_bridge.add_flow(priority=4, in_port=self.INT_OFPORT,
                                      dl_vlan=LV_ID, actions=action_string)

        action_string = 'mod_vlan_vid:%s,output:%s' % (LV_ID, self.INT_OFPORT)
        self.mock_tun_bridge.add_flow(priority=3, tun_id=LS_ID,
                                      actions=action_string)

        self.mox.ReplayAll()

        a = ovs_quantum_agent.OVSQuantumTunnelAgent(self.INT_BRIDGE,
                                                    self.TUN_BRIDGE,
                                                    '10.0.0.1',
                                                    'sudo', 2, 2)
        a.available_local_vlans = set([LV_ID])
        a.provision_local_vlan(NET_UUID, LS_ID)
        self.mox.VerifyAll()