VMware: fix broken tests

Commit 7f406805d93298d0e65d340c2a06ba0d2dd6ff76 broke us due
to constants being moved around

Commit bd1044ba0e9d7d0f4752c891ac340b115f0019c4 also caused some havoc.
Skipped that broken test as we do not support V6 with DHCP

Change-Id: I6f80d89fc7fa1bee38665dbfec9a7b5eca859b0d
This commit is contained in:
Gary Kotton 2015-04-16 01:02:49 -07:00
parent 0246071a5b
commit f90994da04
6 changed files with 22 additions and 17 deletions

View File

@ -16,7 +16,7 @@ from sqlalchemy.orm import exc as sa_orm_exc
from neutron.api.v2 import attributes
from neutron.common import exceptions
from neutron.common import utils
from neutron.plugins.common import utils
from neutron.plugins.vmware.dbexts import nsx_models
from neutron.plugins.vmware.extensions import networkgw
from oslo_log import log as logging

View File

@ -29,7 +29,6 @@ from neutron.api.v2 import attributes as attr
from neutron.api.v2 import base
from neutron.common import constants
from neutron.common import exceptions as n_exc
from neutron.common import utils
from neutron import context as q_context
from neutron.db import agentschedulers_db
from neutron.db import allowedaddresspairs_db as addr_pair_db
@ -54,6 +53,7 @@ from neutron.extensions import portsecurity as psec
from neutron.extensions import providernet as pnet
from neutron.extensions import securitygroup as ext_sg
from neutron.plugins.common import constants as plugin_const
from neutron.plugins.common import utils
from neutron.plugins.vmware.dbexts import nsx_models
from neutron.plugins.vmware.extensions import maclearning as mac_ext
from neutron.plugins.vmware.extensions import networkgw
@ -780,8 +780,8 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
err_msg = (_("%(segmentation_id)s out of range "
"(%(min_id)s through %(max_id)s)") %
{'segmentation_id': segmentation_id,
'min_id': constants.MIN_VLAN_TAG,
'max_id': constants.MAX_VLAN_TAG})
'min_id': plugin_const.MIN_VLAN_TAG,
'max_id': plugin_const.MAX_VLAN_TAG})
else:
# Verify segment is not already allocated
bindings = (
@ -799,8 +799,8 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
err_msg = (_("%(segmentation_id)s out of range "
"(%(min_id)s through %(max_id)s)") %
{'segmentation_id': segmentation_id,
'min_id': constants.MIN_VLAN_TAG,
'max_id': constants.MAX_VLAN_TAG})
'min_id': plugin_const.MIN_VLAN_TAG,
'max_id': plugin_const.MAX_VLAN_TAG})
else:
err_msg = (_("%(net_type_param)s %(net_type_value)s not "
"supported") %

View File

@ -20,9 +20,7 @@ from oslo_utils import excutils
from neutron.api import extensions as neutron_extensions
from neutron.api.v2 import attributes as attr
from neutron.common import constants
from neutron.common import exceptions as n_exc
from neutron.common import utils
from neutron.db import agentschedulers_db
from neutron.db import allowedaddresspairs_db as addr_pair_db
from neutron.db import db_base_plugin_v2
@ -35,6 +33,8 @@ from neutron.extensions import multiprovidernet as mpnet
from neutron.extensions import portbindings as pbin
from neutron.extensions import portsecurity as psec
from neutron.extensions import providernet as pnet
from neutron.plugins.common import constants
from neutron.plugins.common import utils
from vmware_nsx.neutron.plugins import vmware
from vmware_nsx.neutron.plugins.vmware.common import config # noqa

View File

@ -28,7 +28,6 @@ from neutron.api import extensions as neutron_extensions
from neutron.api.v2 import attributes as attr
from neutron.common import constants
from neutron.common import exceptions as n_exc
from neutron.common import utils
from neutron.db import agents_db
from neutron.db import db_base_plugin_v2
from neutron.db import external_net_db
@ -47,6 +46,8 @@ from neutron.extensions import portbindings as pbin
from neutron.extensions import portsecurity as psec
from neutron.extensions import providernet as pnet
from neutron.extensions import securitygroup as ext_sg
from neutron.plugins.common import constants as plugin_const
from neutron.plugins.common import utils
from neutron.plugins.vmware.extensions import (
advancedserviceproviders as as_providers)
from neutron.plugins.vmware.extensions import (
@ -278,8 +279,8 @@ class NsxVPluginV2(agents_db.AgentDbMixin,
err_msg = (_("%(segmentation_id)s out of range "
"(%(min_id)s through %(max_id)s)") %
{'segmentation_id': segmentation_id,
'min_id': constants.MIN_VLAN_TAG,
'max_id': constants.MAX_VLAN_TAG})
'min_id': plugin_const.MIN_VLAN_TAG,
'max_id': plugin_const.MAX_VLAN_TAG})
else:
# Verify segment is not already allocated
bindings = nsxv_db.get_network_bindings_by_vlanid(

View File

@ -13,7 +13,6 @@
# under the License.
from neutron.db import db_base_plugin_v2
from neutron.plugins.common import constants
from oslo_log import log as logging
from oslo_utils import excutils
@ -30,15 +29,18 @@ LOG = logging.getLogger(__name__)
VSE_FWAAS_ALLOW = "accept"
VSE_FWAAS_DENY = "deny"
FWAAS_ALLOW = "allow"
FWAAS_DENY = "deny"
class EdgeFirewallDriver(db_base_plugin_v2.NeutronDbPluginV2):
"""Implementation of driver APIs for
Edge Firewall feature configuration
"""
def _convert_firewall_action(self, action):
if action == constants.FWAAS_ALLOW:
if action == FWAAS_ALLOW:
return VSE_FWAAS_ALLOW
elif action == constants.FWAAS_DENY:
elif action == FWAAS_DENY:
return VSE_FWAAS_DENY
else:
msg = _("Invalid action value %s in a firewall rule") % action
@ -46,9 +48,9 @@ class EdgeFirewallDriver(db_base_plugin_v2.NeutronDbPluginV2):
def _restore_firewall_action(self, action):
if action == VSE_FWAAS_ALLOW:
return constants.FWAAS_ALLOW
return FWAAS_ALLOW
elif action == VSE_FWAAS_DENY:
return constants.FWAAS_DENY
return FWAAS_DENY
else:
msg = (_("Invalid action value %s in "
"a vshield firewall rule") % action)

View File

@ -952,7 +952,6 @@ class TestPortsV2(NsxVPluginV2TestCase,
class TestSubnetsV2(NsxVPluginV2TestCase,
test_plugin.TestSubnetsV2):
def setUp(self,
plugin=PLUGIN_NAME,
ext_mgr=None,
@ -1062,6 +1061,9 @@ class TestSubnetsV2(NsxVPluginV2TestCase,
self.context.session, router_id)['edge_id']
self.assertNotEqual(dhcp_server_id, dhcp_server_id_1)
def test_create_subnet_ipv6_slaac_with_db_reference_error(self):
self.skipTest('Currently not support')
class TestBasicGet(test_plugin.TestBasicGet, NsxVPluginV2TestCase):
pass