Merge "Fix ml2 & nec plugins for allowedaddresspairs tests"
This commit is contained in:
commit
3094c2ab24
@ -654,12 +654,11 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
|||||||
original_port = self._make_port_dict(port_db)
|
original_port = self._make_port_dict(port_db)
|
||||||
updated_port = super(Ml2Plugin, self).update_port(context, id,
|
updated_port = super(Ml2Plugin, self).update_port(context, id,
|
||||||
port)
|
port)
|
||||||
if self.is_address_pairs_attribute_updated(original_port, port):
|
if addr_pair.ADDRESS_PAIRS in port['port']:
|
||||||
self._delete_allowed_address_pairs(context, id)
|
need_port_update_notify |= (
|
||||||
self._process_create_allowed_address_pairs(
|
self.update_address_pairs_on_port(context, id, port,
|
||||||
context, updated_port,
|
original_port,
|
||||||
port['port'][addr_pair.ADDRESS_PAIRS])
|
updated_port))
|
||||||
need_port_update_notify = True
|
|
||||||
elif changed_fixed_ips:
|
elif changed_fixed_ips:
|
||||||
self._check_fixed_ips_and_address_pairs_no_overlap(
|
self._check_fixed_ips_and_address_pairs_no_overlap(
|
||||||
context, updated_port)
|
context, updated_port)
|
||||||
|
@ -597,12 +597,11 @@ class NECPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
|
|||||||
new_port = super(NECPluginV2, self).update_port(context, id, port)
|
new_port = super(NECPluginV2, self).update_port(context, id, port)
|
||||||
portinfo_changed = self._process_portbindings_update(
|
portinfo_changed = self._process_portbindings_update(
|
||||||
context, port['port'], new_port)
|
context, port['port'], new_port)
|
||||||
if self.is_address_pairs_attribute_updated(old_port, port):
|
if addr_pair.ADDRESS_PAIRS in port['port']:
|
||||||
self._delete_allowed_address_pairs(context, id)
|
need_port_update_notify |= (
|
||||||
self._process_create_allowed_address_pairs(
|
self.update_address_pairs_on_port(context, id, port,
|
||||||
context, new_port,
|
old_port,
|
||||||
port['port'][addr_pair.ADDRESS_PAIRS])
|
new_port))
|
||||||
need_port_update_notify = True
|
|
||||||
elif changed_fixed_ips:
|
elif changed_fixed_ips:
|
||||||
self._check_fixed_ips_and_address_pairs_no_overlap(
|
self._check_fixed_ips_and_address_pairs_no_overlap(
|
||||||
context, new_port)
|
context, new_port)
|
||||||
|
@ -28,6 +28,7 @@ from neutron.plugins.ml2 import config
|
|||||||
from neutron.plugins.ml2 import plugin as ml2_plugin
|
from neutron.plugins.ml2 import plugin as ml2_plugin
|
||||||
from neutron.tests.unit import _test_extension_portbindings as test_bindings
|
from neutron.tests.unit import _test_extension_portbindings as test_bindings
|
||||||
from neutron.tests.unit import test_db_plugin as test_plugin
|
from neutron.tests.unit import test_db_plugin as test_plugin
|
||||||
|
from neutron.tests.unit import test_extension_allowedaddresspairs as test_pair
|
||||||
from neutron.tests.unit import test_extension_extradhcpopts as test_dhcpopts
|
from neutron.tests.unit import test_extension_extradhcpopts as test_dhcpopts
|
||||||
from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc
|
from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc
|
||||||
|
|
||||||
@ -315,6 +316,13 @@ class TestMultiSegmentNetworks(Ml2PluginV2TestCase):
|
|||||||
self.assertIsNone(network[pnet.SEGMENTATION_ID])
|
self.assertIsNone(network[pnet.SEGMENTATION_ID])
|
||||||
|
|
||||||
|
|
||||||
|
class TestMl2AllowedAddressPairs(Ml2PluginV2TestCase,
|
||||||
|
test_pair.TestAllowedAddressPairs):
|
||||||
|
def setUp(self, plugin=None):
|
||||||
|
super(test_pair.TestAllowedAddressPairs, self).setUp(
|
||||||
|
plugin=PLUGIN_NAME)
|
||||||
|
|
||||||
|
|
||||||
class DHCPOptsTestCase(test_dhcpopts.TestExtraDhcpOpt):
|
class DHCPOptsTestCase(test_dhcpopts.TestExtraDhcpOpt):
|
||||||
|
|
||||||
def setUp(self, plugin=None):
|
def setUp(self, plugin=None):
|
||||||
|
@ -31,6 +31,7 @@ from neutron.plugins.nec.db import api as ndb
|
|||||||
from neutron.plugins.nec import nec_plugin
|
from neutron.plugins.nec import nec_plugin
|
||||||
from neutron.tests.unit.nec import fake_ofc_manager
|
from neutron.tests.unit.nec import fake_ofc_manager
|
||||||
from neutron.tests.unit import test_db_plugin as test_plugin
|
from neutron.tests.unit import test_db_plugin as test_plugin
|
||||||
|
from neutron.tests.unit import test_extension_allowedaddresspairs as test_pair
|
||||||
|
|
||||||
|
|
||||||
PLUGIN_NAME = 'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
PLUGIN_NAME = 'neutron.plugins.nec.nec_plugin.NECPluginV2'
|
||||||
@ -890,3 +891,8 @@ class TestNecPluginOfcManager(NecPluginV2TestCase):
|
|||||||
def test_delete_port_for_noofcmap_ofc_port(self):
|
def test_delete_port_for_noofcmap_ofc_port(self):
|
||||||
self._test_delete_port_for_disappeared_ofc_port(
|
self._test_delete_port_for_disappeared_ofc_port(
|
||||||
nexc.OFCMappingNotFound(resource='port', neutron_id='port1'))
|
nexc.OFCMappingNotFound(resource='port', neutron_id='port1'))
|
||||||
|
|
||||||
|
|
||||||
|
class TestNecAllowedAddressPairs(NecPluginV2TestCase,
|
||||||
|
test_pair.TestAllowedAddressPairs):
|
||||||
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user