-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2011 Nicira, Inc.
+# Copyright 2014 VMware, Inc.
+#
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+#
-import eventlet
-eventlet.monkey_patch()
-import logging
-import urllib2
-
-from neutron.tests import base
-
-logging.basicConfig(level=logging.DEBUG)
-lg = logging.getLogger("test_nvp_api_request")
-
-REQUEST_TIMEOUT = 1
-
-
-def fetch(url):
- return urllib2.urlopen(url).read()
-
-
-class NvpApiRequestTest(base.BaseTestCase):
+from neutron.plugins.nicira import NeutronPlugin
+from neutron.plugins.nicira import NeutronServicePlugin
- pass
+NsxPlugin = NeutronPlugin.NvpPluginV2
+NsxServicePlugin = NeutronServicePlugin.NvpAdvancedPlugin
import neutron.plugins.nicira.api_client.client_eventlet as client
from neutron.plugins.nicira import extensions
-import neutron.plugins.nicira.NeutronPlugin as plugin
-import neutron.plugins.nicira.NeutronServicePlugin as service_plugin
import neutron.plugins.nicira.NvpApiClient as nvpapi
from neutron.plugins.nicira import nvplib
-from neutron.plugins.nicira.vshield.common import (
- VcnsApiClient as vcnsapi)
+from neutron.plugins.nicira.vshield.common import VcnsApiClient as vcnsapi
from neutron.plugins.nicira.vshield import vcns
import neutron.plugins.nicira.vshield.vcns_driver as vcnsdriver
+import neutron.plugins.vmware.plugin as neutron_plugin
-nvp_plugin = plugin.NvpPluginV2
-nvp_service_plugin = service_plugin.NvpAdvancedPlugin
+plugin = neutron_plugin.NsxPlugin
+service_plugin = neutron_plugin.NsxServicePlugin
api_helper = nvpapi.NVPApiHelper
-nvp_client = client.NvpApiClientEventlet
+api_client = client.NvpApiClientEventlet
vcns_class = vcns.Vcns
vcns_driver = vcnsdriver.VcnsDriver
vcns_api_helper = vcnsapi.VcnsApiHelper
STUBS_PATH = os.path.join(os.path.dirname(__file__), 'etc')
-NVPEXT_PATH = os.path.dirname(extensions.__file__)
-NVPAPI_NAME = '%s.%s' % (api_helper.__module__, api_helper.__name__)
-NVPLIB_NAME = nvplib.__name__
-PLUGIN_NAME = '%s.%s' % (nvp_plugin.__module__, nvp_plugin.__name__)
-SERVICE_PLUGIN_NAME = '%s.%s' % (nvp_service_plugin.__module__,
- nvp_service_plugin.__name__)
-CLIENT_NAME = '%s.%s' % (nvp_client.__module__, nvp_client.__name__)
+NSXEXT_PATH = os.path.dirname(extensions.__file__)
+NSXAPI_NAME = '%s.%s' % (api_helper.__module__, api_helper.__name__)
+NSXLIB_NAME = nvplib.__name__
+PLUGIN_NAME = '%s.%s' % (plugin.__module__, plugin.__name__)
+SERVICE_PLUGIN_NAME = '%s.%s' % (service_plugin.__module__,
+ service_plugin.__name__)
+CLIENT_NAME = '%s.%s' % (api_client.__module__, api_client.__name__)
VCNS_NAME = '%s.%s' % (vcns_class.__module__, vcns_class.__name__)
VCNS_DRIVER_NAME = '%s.%s' % (vcns_driver.__module__, vcns_driver.__name__)
-VCNSAPI_NAME = '%s.%s' % (vcns_api_helper.__module__,
- vcns_api_helper.__name__)
+VCNSAPI_NAME = '%s.%s' % (vcns_api_helper.__module__, vcns_api_helper.__name__)
def get_fake_conf(filename):
return os.path.join(STUBS_PATH, filename)
-def nicira_method(method_name, module_name='nvplib'):
+def nsx_method(method_name, module_name='nvplib'):
return '%s.%s.%s' % ('neutron.plugins.nicira', module_name, method_name)
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2011 Nicira, Inc.
+# Copyright 2011 VMware, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# License for the specific language governing permissions and limitations
# under the License.
-# System
import httplib
-# Local
import neutron.plugins.nicira.api_client.common as naco
from neutron.tests import base
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright (C) 2009-2012 Nicira Networks, Inc. All Rights Reserved.
+# Copyright (C) 2009-2012 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
from neutron.plugins.nicira.api_client import client_eventlet as nace
from neutron.plugins.nicira.api_client import request_eventlet as nare
from neutron.tests import base
-from neutron.tests.unit.nicira import CLIENT_NAME
+from neutron.tests.unit.vmware import CLIENT_NAME
logging.basicConfig(level=logging.DEBUG)
-LOG = logging.getLogger("test_nvp_api_request_eventlet")
+LOG = logging.getLogger("test_api_request_eventlet")
REQUEST_TIMEOUT = 1
self.client.acquire_connection.return_value = None
self.req._issue_request()
- LOG.info('request_error: %s' % self.req._request_error)
self.assertIsInstance(self.req._request_error, Exception)
self.assertTrue(self.client.acquire_connection.called)
from neutron.plugins.nicira import NvpApiClient
from neutron.plugins.nicira import nvplib
from neutron.tests import base
-from neutron.tests.unit.nicira import fake_nvpapiclient
-from neutron.tests.unit.nicira import NVPAPI_NAME
-from neutron.tests.unit.nicira import STUBS_PATH
from neutron.tests.unit import test_api_v2
+from neutron.tests.unit.vmware import fake_nvpapiclient
+from neutron.tests.unit.vmware import NSXAPI_NAME
+from neutron.tests.unit.vmware import STUBS_PATH
_uuid = test_api_v2._uuid
def setUp(self):
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nsxapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nsxapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nsxapi.start()
instance.return_value.login.return_value = "the_cookie"
fake_version = getattr(self, 'fake_version', "3.0")
def setUp(self):
# mock nsx api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nsxapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nsxapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nsxapi.start()
instance.return_value.login.return_value = "the_cookie"
# Choose 3.0, but the version is irrelevant for the aim of
from neutron.plugins.nicira.nsxlib import l2gateway as l2gwlib
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.nicira import nvplib
-from neutron.tests.unit.nicira.nsxlib import base
from neutron.tests.unit import test_api_v2
+from neutron.tests.unit.vmware.nsxlib import base
_uuid = test_api_v2._uuid
from neutron.common import exceptions
from neutron.plugins.nicira.nsxlib import queue as queuelib
from neutron.plugins.nicira import NvpApiClient
-from neutron.tests.unit.nicira.nsxlib import base
+from neutron.tests.unit.vmware.nsxlib import base
class TestLogicalQueueLib(base.NsxlibTestCase):
from neutron.plugins.nicira.nsxlib import switch as switchlib
from neutron.plugins.nicira import NvpApiClient
from neutron.plugins.nicira import nvplib
-from neutron.tests.unit.nicira.nsxlib import base
from neutron.tests.unit import test_api_v2
+from neutron.tests.unit.vmware.nsxlib import base
_uuid = test_api_v2._uuid
from neutron.common import exceptions
from neutron.plugins.nicira.nsxlib import secgroup as secgrouplib
from neutron.plugins.nicira import nvplib
-from neutron.tests.unit.nicira.nsxlib import base
+from neutron.tests.unit.vmware.nsxlib import base
class SecurityProfileTestCase(base.NsxlibTestCase):
from neutron.common import exceptions
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira.nsxlib import switch as switchlib
-from neutron.tests.unit.nicira.nsxlib import base
from neutron.tests.unit import test_api_v2
+from neutron.tests.unit.vmware.nsxlib import base
_uuid = test_api_v2._uuid
from neutron.common.test_lib import test_config
from neutron.plugins.nicira.common import sync
from neutron.plugins.nicira.dhcp_meta import rpc
-from neutron.tests.unit.nicira import fake_nvpapiclient
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import NVPAPI_NAME
-from neutron.tests.unit.nicira import PLUGIN_NAME
-from neutron.tests.unit.nicira import STUBS_PATH
from neutron.tests.unit.openvswitch import test_agent_scheduler as test_base
+from neutron.tests.unit.vmware import fake_nvpapiclient
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import NSXAPI_NAME
+from neutron.tests.unit.vmware import PLUGIN_NAME
+from neutron.tests.unit.vmware import STUBS_PATH
class NVPDhcpAgentNotifierTestCase(test_base.OvsDhcpAgentNotifierTestCase):
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nvpapi.start()
# Avoid runs of the synchronizer looping call
patch_sync = mock.patch.object(sync, '_start_loopingcall')
from neutron.plugins.nicira.common import utils
from neutron.plugins.nicira import NeutronServicePlugin as nsp
from neutron.tests import base
-from neutron.tests.unit.nicira import NVPEXT_PATH
-from neutron.tests.unit.nicira import SERVICE_PLUGIN_NAME
-from neutron.tests.unit.nicira import test_nicira_plugin
-from neutron.tests.unit.nicira import VCNS_NAME
-from neutron.tests.unit.nicira.vshield import fake_vcns
from neutron.tests.unit import test_l3_plugin
+from neutron.tests.unit.vmware import NSXEXT_PATH
+from neutron.tests.unit.vmware import SERVICE_PLUGIN_NAME
+from neutron.tests.unit.vmware import test_nsx_plugin
+from neutron.tests.unit.vmware import VCNS_NAME
+from neutron.tests.unit.vmware.vshield import fake_vcns
_uuid = uuidutils.generate_uuid
return []
-class ServiceRouterTest(test_nicira_plugin.NiciraL3NatTest,
+class ServiceRouterTest(test_nsx_plugin.NiciraL3NatTest,
test_l3_plugin.L3NatTestCaseMixin):
def vcns_patch(self):
self.fc2.enable_service_loadbalancer)
def setUp(self, ext_mgr=None, service_plugins=None):
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
cfg.CONF.set_override('task_status_check_interval', 100, group="vcns")
# vcns does not support duplicated router name, ignore router name
class ServiceRouterTestCase(ServiceRouterTest,
- test_nicira_plugin.TestNiciraL3NatTestCase):
+ test_nsx_plugin.TestNiciraL3NatTestCase):
def test_router_create(self):
name = 'router1'
from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants as const
from neutron.tests.unit.db.firewall import test_db_firewall
-from neutron.tests.unit.nicira import test_edge_router
+from neutron.tests.unit.vmware import test_edge_router
_uuid = uuidutils.generate_uuid
-FW_PLUGIN_CLASS = (
- "neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin"
-)
+FW_PLUGIN_CLASS = "neutron.plugins.vmware.plugin.NsxServicePlugin"
class FirewallTestExtensionManager(
from neutron import manager
from neutron.openstack.common import uuidutils
from neutron.tests.unit.db.loadbalancer import test_db_loadbalancer
-from neutron.tests.unit.nicira import test_edge_router
+from neutron.tests.unit.vmware import test_edge_router
_uuid = uuidutils.generate_uuid
-LBAAS_PLUGIN_CLASS = (
- "neutron.plugins.nicira.NeutronServicePlugin.NvpAdvancedPlugin"
-)
+LBAAS_PLUGIN_CLASS = "neutron.plugins.vmware.plugin.NsxServicePlugin"
class LoadBalancerTestExtensionManager(
from neutron.extensions import agent
from neutron.plugins.nicira.common import sync
from neutron.plugins.nicira.NvpApiClient import NVPVersion
-from neutron.tests.unit.nicira import fake_nvpapiclient
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import NVPAPI_NAME
-from neutron.tests.unit.nicira import NVPEXT_PATH
-from neutron.tests.unit.nicira import PLUGIN_NAME
-from neutron.tests.unit.nicira import STUBS_PATH
from neutron.tests.unit import test_db_plugin
+from neutron.tests.unit.vmware import fake_nvpapiclient
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import NSXAPI_NAME
+from neutron.tests.unit.vmware import NSXEXT_PATH
+from neutron.tests.unit.vmware import PLUGIN_NAME
+from neutron.tests.unit.vmware import STUBS_PATH
class MacLearningExtensionManager(object):
def setUp(self):
self.adminContext = context.get_admin_context()
test_config['config_files'] = [get_fake_conf('nsx.ini.full.test')]
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
# Save the original RESOURCE_ATTRIBUTE_MAP
self.saved_attr_map = {}
for resource, attrs in attributes.RESOURCE_ATTRIBUTE_MAP.iteritems():
ext_mgr = MacLearningExtensionManager()
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nvpapi.start()
# Avoid runs of the synchronizer looping call
patch_sync = mock.patch.object(sync, '_start_loopingcall')
from neutron.plugins.nicira.nsxlib import lsn as lsnlib
from neutron.plugins.nicira import NvpApiClient as nvp_client
from neutron.tests import base
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import PLUGIN_NAME
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import PLUGIN_NAME
BASE_CONF_PATH = get_fake_conf('neutron.conf.test')
NSX_INI_PATH = get_fake_conf('nsx.ini.basic.test')
from neutron.plugins.nicira import NvpApiClient
from neutron.plugins.nicira.NvpApiClient import NVPVersion
from neutron.tests.unit import _test_extension_portbindings as test_bindings
-from neutron.tests.unit.nicira import fake_nvpapiclient
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import NVPAPI_NAME
-from neutron.tests.unit.nicira import NVPEXT_PATH
-from neutron.tests.unit.nicira import PLUGIN_NAME
-from neutron.tests.unit.nicira import STUBS_PATH
-import neutron.tests.unit.nicira.test_networkgw as test_l2_gw
import neutron.tests.unit.test_db_plugin as test_plugin
import neutron.tests.unit.test_extension_allowedaddresspairs as test_addr_pair
import neutron.tests.unit.test_extension_ext_gw_mode as test_ext_gw_mode
from neutron.tests.unit import test_extensions
import neutron.tests.unit.test_l3_plugin as test_l3_plugin
from neutron.tests.unit import testlib_api
+from neutron.tests.unit.vmware import fake_nvpapiclient
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import NSXAPI_NAME
+from neutron.tests.unit.vmware import NSXEXT_PATH
+from neutron.tests.unit.vmware import PLUGIN_NAME
+from neutron.tests.unit.vmware import STUBS_PATH
+import neutron.tests.unit.vmware.test_networkgw as test_l2_gw
from neutron.openstack.common import log
test_lib.test_config['config_files'] = [get_fake_conf('nsx.ini.test')]
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
self.mock_instance = self.mock_nvpapi.start()
# Avoid runs of the synchronizer looping call
patch_sync = mock.patch.object(sync, '_start_loopingcall')
test_lib.test_config['config_files'] = [get_fake_conf('nsx.ini.test')]
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nvpapi.start()
instance.return_value.login.return_value = "the_cookie"
# Avoid runs of the synchronizer looping call
test_lib.test_config['config_files'] = [get_fake_conf('nsx.ini.test')]
# mock nvp api client
fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- self.mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ self.mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
instance = self.mock_nvpapi.start()
instance.return_value.login.return_value = "the_cookie"
# Avoid runs of the synchronizer looping call
for item in l3.RESOURCE_ATTRIBUTE_MAP:
self._l3_attribute_map_bk[item] = (
l3.RESOURCE_ATTRIBUTE_MAP[item].copy())
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
l3_attribute_map_bk = backup_l3_attribute_map()
self.addCleanup(restore_l3_attribute_map, l3_attribute_map_bk)
ext_mgr = ext_mgr or TestNiciraL3ExtensionManager()
class TestQoSQueue(NiciraPluginV2TestCase):
def setUp(self, plugin=None):
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
super(TestQoSQueue, self).setUp()
ext_mgr = NvpQoSTestExtensionManager()
self.ext_api = test_extensions.setup_extensions_middleware(ext_mgr)
test_l2_gw.NetworkGatewayDbTestCase):
def setUp(self, plugin=PLUGIN_NAME, ext_mgr=None):
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
super(TestNiciraNetworkGateway,
self).setUp(plugin=plugin, ext_mgr=ext_mgr)
class TestNiciraMultiProviderNetworks(NiciraPluginV2TestCase):
def setUp(self, plugin=None):
- cfg.CONF.set_override('api_extensions_path', NVPEXT_PATH)
+ cfg.CONF.set_override('api_extensions_path', NSXEXT_PATH)
super(TestNiciraMultiProviderNetworks, self).setUp()
def test_create_network_provider(self):
from neutron.common import constants
from neutron import context
from neutron.openstack.common import jsonutils as json
+from neutron.openstack.common import log
from neutron.plugins.nicira.common import sync
-from neutron.plugins.nicira import NeutronPlugin
from neutron.plugins.nicira import nsx_cluster
from neutron.plugins.nicira import NvpApiClient
from neutron.plugins.nicira import nvplib
+from neutron.plugins.vmware import plugin
from neutron.tests import base
-from neutron.tests.unit.nicira import fake_nvpapiclient
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import NVPAPI_NAME
-from neutron.tests.unit.nicira import STUBS_PATH
from neutron.tests.unit import test_api_v2
-
-from neutron.openstack.common import log
+from neutron.tests.unit.vmware import fake_nvpapiclient
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import NSXAPI_NAME
+from neutron.tests.unit.vmware import STUBS_PATH
LOG = log.getLogger(__name__)
def setUp(self):
# mock nvp api client
self.fc = fake_nvpapiclient.FakeClient(STUBS_PATH)
- mock_nvpapi = mock.patch(NVPAPI_NAME, autospec=True)
+ mock_nvpapi = mock.patch(NSXAPI_NAME, autospec=True)
# Avoid runs of the synchronizer looping call
# These unit tests will excplicitly invoke synchronization
patch_sync = mock.patch.object(sync, '_start_loopingcall')
'--config-file', get_fake_conf('nsx.ini.test')]
config.parse(args=args)
cfg.CONF.set_override('allow_overlapping_ips', True)
- self._plugin = NeutronPlugin.NvpPluginV2()
+ self._plugin = plugin.NsxPlugin()
# Mock neutron manager plugin load functions to speed up tests
mock_nm_get_plugin = mock.patch('neutron.manager.NeutronManager.'
'get_plugin')
from neutron.plugins.nicira import NvpApiClient
from neutron.plugins.nicira import nvplib
from neutron.tests import base
-from neutron.tests.unit.nicira import nicira_method
-from neutron.tests.unit.nicira.nsxlib import base as nsx_base
+from neutron.tests.unit.vmware import nsx_method
+from neutron.tests.unit.vmware.nsxlib import base as nsx_base
class NsxUtilsTestCase(base.BaseTestCase):
# Mock relevant db calls
# This will allow for avoiding setting up the plugin
# for creating db entries
- mock.patch(nicira_method('get_nsx_switch_and_port_id',
- module_name='dbexts.nicira_db'),
+ mock.patch(nsx_method('get_nsx_switch_and_port_id',
+ module_name='dbexts.nicira_db'),
return_value=ret_value).start()
- mock.patch(nicira_method('add_neutron_nsx_port_mapping',
- module_name='dbexts.nicira_db')).start()
- mock.patch(nicira_method('delete_neutron_nsx_port_mapping',
- module_name='dbexts.nicira_db')).start()
+ mock.patch(nsx_method('add_neutron_nsx_port_mapping',
+ module_name='dbexts.nicira_db')).start()
+ mock.patch(nsx_method('delete_neutron_nsx_port_mapping',
+ module_name='dbexts.nicira_db')).start()
def _mock_network_mapping_db_calls(self, ret_value):
# Mock relevant db calls
# This will allow for avoiding setting up the plugin
# for creating db entries
- mock.patch(nicira_method('get_nsx_switch_ids',
- module_name='dbexts.nicira_db'),
+ mock.patch(nsx_method('get_nsx_switch_ids',
+ module_name='dbexts.nicira_db'),
return_value=ret_value).start()
- mock.patch(nicira_method('add_neutron_nsx_network_mapping',
- module_name='dbexts.nicira_db')).start()
+ mock.patch(nsx_method('add_neutron_nsx_network_mapping',
+ module_name='dbexts.nicira_db')).start()
def _mock_router_mapping_db_calls(self, ret_value):
# Mock relevant db calls
# This will allow for avoiding setting up the plugin
# for creating db entries
- mock.patch(nicira_method('get_nsx_router_id',
- module_name='dbexts.nicira_db'),
+ mock.patch(nsx_method('get_nsx_router_id',
+ module_name='dbexts.nicira_db'),
return_value=ret_value).start()
- mock.patch(nicira_method('add_neutron_nsx_router_mapping',
- module_name='dbexts.nicira_db')).start()
+ mock.patch(nsx_method('add_neutron_nsx_router_mapping',
+ module_name='dbexts.nicira_db')).start()
def _verify_get_nsx_switch_and_port_id(self, exp_ls_uuid, exp_lp_uuid):
# The nvplib and db calls are mocked, therefore the cluster
exp_lp_uuid = uuidutils.generate_uuid()
ret_value = None, exp_lp_uuid
self._mock_port_mapping_db_calls(ret_value)
- with mock.patch(nicira_method('query_lswitch_lports',
- module_name='nsxlib.switch'),
+ with mock.patch(nsx_method('query_lswitch_lports',
+ module_name='nsxlib.switch'),
return_value=[{'uuid': exp_lp_uuid,
'_relations': {
'LogicalSwitchConfig': {
exp_lp_uuid = uuidutils.generate_uuid()
ret_value = None, None
self._mock_port_mapping_db_calls(ret_value)
- with mock.patch(nicira_method('query_lswitch_lports',
- module_name='nsxlib.switch'),
+ with mock.patch(nsx_method('query_lswitch_lports',
+ module_name='nsxlib.switch'),
return_value=[{'uuid': exp_lp_uuid,
'_relations': {
'LogicalSwitchConfig': {
# mappings are not found both in the db and the backend
ret_value = None, None
self._mock_port_mapping_db_calls(ret_value)
- with mock.patch(nicira_method('query_lswitch_lports',
- module_name='nsxlib.switch'),
+ with mock.patch(nsx_method('query_lswitch_lports',
+ module_name='nsxlib.switch'),
return_value=[]):
self._verify_get_nsx_switch_and_port_id(None, None)
# found for a given network identifier
exp_ls_uuids = [uuidutils.generate_uuid()]
self._mock_network_mapping_db_calls(None)
- with mock.patch(nicira_method('get_lswitches',
- module_name='nsxlib.switch'),
+ with mock.patch(nsx_method('get_lswitches',
+ module_name='nsxlib.switch'),
return_value=[{'uuid': uuid}
for uuid in exp_ls_uuids]):
self._verify_get_nsx_switch_ids(exp_ls_uuids)
# This test verifies that the function returns None if the mappings
# are not found both in the db and in the backend
self._mock_network_mapping_db_calls(None)
- with mock.patch(nicira_method('get_lswitches',
- module_name='nsxlib.switch'),
+ with mock.patch(nsx_method('get_lswitches',
+ module_name='nsxlib.switch'),
return_value=[]):
self._verify_get_nsx_switch_ids(None)
# found for a given port identifier
exp_lr_uuid = uuidutils.generate_uuid()
self._mock_router_mapping_db_calls(None)
- with mock.patch(nicira_method('query_lrouters',
- module_name='nsxlib.router'),
+ with mock.patch(nsx_method('query_lrouters',
+ module_name='nsxlib.router'),
return_value=[{'uuid': exp_lr_uuid}]):
self._verify_get_nsx_router_id(exp_lr_uuid)
# This test verifies that the function returns None if the mapping
# are not found both in the db and in the backend
self._mock_router_mapping_db_calls(None)
- with mock.patch(nicira_method('query_lrouters',
- module_name='nsxlib.router'),
+ with mock.patch(nsx_method('query_lrouters',
+ module_name='nsxlib.router'),
return_value=[]):
self._verify_get_nsx_router_id(None)
from neutron.plugins.nicira.vshield.tasks import tasks as ts
from neutron.plugins.nicira.vshield import vcns_driver
from neutron.tests import base
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import VCNS_NAME
-from neutron.tests.unit.nicira.vshield import fake_vcns
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import VCNS_NAME
+from neutron.tests.unit.vmware.vshield import fake_vcns
VCNS_CONFIG_FILE = get_fake_conf("vcns.ini.test")
from neutron.plugins.nicira.vshield.common import exceptions as vcns_exc
from neutron.plugins.nicira.vshield import vcns_driver
from neutron.tests.unit.db.firewall import test_db_firewall
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import VCNS_NAME
-from neutron.tests.unit.nicira.vshield import fake_vcns
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import VCNS_NAME
+from neutron.tests.unit.vmware.vshield import fake_vcns
_uuid = uuidutils.generate_uuid
from neutron.plugins.nicira.vshield.common import (
exceptions as vcns_exc)
from neutron.tests.unit.db.loadbalancer import test_db_loadbalancer
-from neutron.tests.unit.nicira import get_fake_conf
-from neutron.tests.unit.nicira import VCNS_NAME
-from neutron.tests.unit.nicira.vshield import fake_vcns
+from neutron.tests.unit.vmware import get_fake_conf
+from neutron.tests.unit.vmware import VCNS_NAME
+from neutron.tests.unit.vmware.vshield import fake_vcns
_uuid = uuidutils.generate_uuid
openvswitch = neutron.plugins.openvswitch.ovs_neutron_plugin:OVSNeutronPluginV2
plumgrid = neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin:NeutronPluginPLUMgridV2
ryu = neutron.plugins.ryu.ryu_neutron_plugin:RyuNeutronPluginV2
+ vmware = neutron.plugins.vmware.plugin:NsxPlugin
neutron.service_plugins =
dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin
router = neutron.services.l3_router.l3_router_plugin:L3RouterPlugin