From 8b8fb4dfc0b9b81da163e0147f2efb3ba2356058 Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Mon, 3 Feb 2014 13:03:29 -0800 Subject: [PATCH] Rename Neutron core/service plugins for VMware NSX Short aliases are introduced for the NSX plugin(s). This patch also switches to using the new plugin names/naming scheme in the unit tests. Partial-implements blueprint: nicira-plugin-renaming Change-Id: If1f1431b098bf77b9c85e0afb3d7848083d9d451 --- .../nsxlib => plugins/vmware}/__init__.py | 0 .../vmware/plugin.py} | 29 +++------ .../tests/unit/{nicira => vmware}/__init__.py | 31 +++++----- .../tests/unit/vmware/apiclient/__init__.py | 0 .../apiclient/test_api_common.py} | 4 +- .../apiclient/test_api_request_eventlet.py} | 7 +-- .../etc/fake_get_gwservice.json | 0 .../etc/fake_get_lqueue.json | 0 .../etc/fake_get_lrouter.json | 0 .../etc/fake_get_lrouter_lport.json | 0 .../etc/fake_get_lrouter_lport_att.json | 0 .../etc/fake_get_lrouter_nat.json | 0 .../etc/fake_get_lswitch.json | 0 .../etc/fake_get_lswitch_lport.json | 0 .../etc/fake_get_lswitch_lport_att.json | 0 .../etc/fake_get_lswitch_lport_status.json | 0 .../etc/fake_get_security_profile.json | 0 .../etc/fake_post_gwservice.json | 0 .../etc/fake_post_lqueue.json | 0 .../etc/fake_post_lrouter.json | 0 .../etc/fake_post_lrouter_lport.json | 0 .../etc/fake_post_lrouter_nat.json | 0 .../etc/fake_post_lswitch.json | 0 .../etc/fake_post_lswitch_lport.json | 0 .../etc/fake_post_security_profile.json | 0 .../etc/fake_put_lrouter_lport_att.json | 0 .../etc/fake_put_lswitch_lport_att.json | 0 .../{nicira => vmware}/etc/neutron.conf.test | 0 .../etc/nsx.ini.agentless.test | 0 .../{nicira => vmware}/etc/nsx.ini.basic.test | 0 .../{nicira => vmware}/etc/nsx.ini.full.test | 0 .../unit/{nicira => vmware}/etc/nsx.ini.test | 0 .../{nicira => vmware}/etc/nvp.ini.full.test | 0 .../unit/{nicira => vmware}/etc/vcns.ini.test | 0 .../{nicira => vmware}/fake_nvpapiclient.py | 0 neutron/tests/unit/vmware/nsxlib/__init__.py | 0 .../unit/{nicira => vmware}/nsxlib/base.py | 10 ++-- .../nsxlib/test_l2gateway.py | 2 +- .../{nicira => vmware}/nsxlib/test_lsn.py | 0 .../{nicira => vmware}/nsxlib/test_queue.py | 2 +- .../{nicira => vmware}/nsxlib/test_router.py | 2 +- .../nsxlib/test_secgroup.py | 2 +- .../{nicira => vmware}/nsxlib/test_switch.py | 2 +- .../nsxlib/test_versioning.py | 0 .../test_agent_scheduler.py | 12 ++-- .../unit/{nicira => vmware}/test_dhcpmeta.py | 0 .../{nicira => vmware}/test_edge_router.py | 16 ++--- .../{nicira => vmware}/test_fwaas_plugin.py | 6 +- .../{nicira => vmware}/test_lbaas_plugin.py | 6 +- .../{nicira => vmware}/test_maclearning.py | 16 ++--- .../unit/{nicira => vmware}/test_networkgw.py | 0 .../test_nsx_db.py} | 0 .../test_nsx_opts.py} | 4 +- .../test_nsx_plugin.py} | 28 ++++----- .../test_nsx_sync.py} | 17 +++--- .../unit/{nicira => vmware}/test_nsx_utils.py | 60 +++++++++---------- .../{nicira => vmware}/test_vcns_driver.py | 6 +- .../{nicira => vmware}/vshield/__init__.py | 0 .../{nicira => vmware}/vshield/fake_vcns.py | 0 .../vshield/test_firewall_driver.py | 6 +- .../vshield/test_loadbalancer_driver.py | 6 +- setup.cfg | 1 + 62 files changed, 125 insertions(+), 150 deletions(-) rename neutron/{tests/unit/nicira/nsxlib => plugins/vmware}/__init__.py (100%) rename neutron/{tests/unit/nicira/test_nvp_api_request.py => plugins/vmware/plugin.py} (59%) rename neutron/tests/unit/{nicira => vmware}/__init__.py (62%) create mode 100644 neutron/tests/unit/vmware/apiclient/__init__.py rename neutron/tests/unit/{nicira/test_nvp_api_common.py => vmware/apiclient/test_api_common.py} (96%) rename neutron/tests/unit/{nicira/test_nvp_api_request_eventlet.py => vmware/apiclient/test_api_request_eventlet.py} (98%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_gwservice.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lqueue.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lrouter.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lrouter_lport.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lrouter_lport_att.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lrouter_nat.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lswitch.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lswitch_lport.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lswitch_lport_att.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_lswitch_lport_status.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_get_security_profile.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_gwservice.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lqueue.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lrouter.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lrouter_lport.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lrouter_nat.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lswitch.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_lswitch_lport.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_post_security_profile.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_put_lrouter_lport_att.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/fake_put_lswitch_lport_att.json (100%) rename neutron/tests/unit/{nicira => vmware}/etc/neutron.conf.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/nsx.ini.agentless.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/nsx.ini.basic.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/nsx.ini.full.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/nsx.ini.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/nvp.ini.full.test (100%) rename neutron/tests/unit/{nicira => vmware}/etc/vcns.ini.test (100%) rename neutron/tests/unit/{nicira => vmware}/fake_nvpapiclient.py (100%) create mode 100644 neutron/tests/unit/vmware/nsxlib/__init__.py rename neutron/tests/unit/{nicira => vmware}/nsxlib/base.py (92%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_l2gateway.py (99%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_lsn.py (100%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_queue.py (98%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_router.py (99%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_secgroup.py (99%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_switch.py (99%) rename neutron/tests/unit/{nicira => vmware}/nsxlib/test_versioning.py (100%) rename neutron/tests/unit/{nicira => vmware}/test_agent_scheduler.py (89%) rename neutron/tests/unit/{nicira => vmware}/test_dhcpmeta.py (100%) rename neutron/tests/unit/{nicira => vmware}/test_edge_router.py (96%) rename neutron/tests/unit/{nicira => vmware}/test_fwaas_plugin.py (99%) rename neutron/tests/unit/{nicira => vmware}/test_lbaas_plugin.py (99%) rename neutron/tests/unit/{nicira => vmware}/test_maclearning.py (93%) rename neutron/tests/unit/{nicira => vmware}/test_networkgw.py (100%) rename neutron/tests/unit/{nicira/test_nicira_db.py => vmware/test_nsx_db.py} (100%) rename neutron/tests/unit/{nicira/test_nvpopts.py => vmware/test_nsx_opts.py} (99%) rename neutron/tests/unit/{nicira/test_nicira_plugin.py => vmware/test_nsx_plugin.py} (98%) rename neutron/tests/unit/{nicira/test_nvp_sync.py => vmware/test_nsx_sync.py} (98%) rename neutron/tests/unit/{nicira => vmware}/test_nsx_utils.py (85%) rename neutron/tests/unit/{nicira => vmware}/test_vcns_driver.py (99%) rename neutron/tests/unit/{nicira => vmware}/vshield/__init__.py (100%) rename neutron/tests/unit/{nicira => vmware}/vshield/fake_vcns.py (100%) rename neutron/tests/unit/{nicira => vmware}/vshield/test_firewall_driver.py (99%) rename neutron/tests/unit/{nicira => vmware}/vshield/test_loadbalancer_driver.py (98%) diff --git a/neutron/tests/unit/nicira/nsxlib/__init__.py b/neutron/plugins/vmware/__init__.py similarity index 100% rename from neutron/tests/unit/nicira/nsxlib/__init__.py rename to neutron/plugins/vmware/__init__.py diff --git a/neutron/tests/unit/nicira/test_nvp_api_request.py b/neutron/plugins/vmware/plugin.py similarity index 59% rename from neutron/tests/unit/nicira/test_nvp_api_request.py rename to neutron/plugins/vmware/plugin.py index 5687f7988..19c99c93c 100644 --- a/neutron/tests/unit/nicira/test_nvp_api_request.py +++ b/neutron/plugins/vmware/plugin.py @@ -1,6 +1,5 @@ -# 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 @@ -14,24 +13,10 @@ # 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 diff --git a/neutron/tests/unit/nicira/__init__.py b/neutron/tests/unit/vmware/__init__.py similarity index 62% rename from neutron/tests/unit/nicira/__init__.py rename to neutron/tests/unit/vmware/__init__.py index 9d5a849ed..d6210f3a9 100644 --- a/neutron/tests/unit/nicira/__init__.py +++ b/neutron/tests/unit/vmware/__init__.py @@ -19,40 +19,37 @@ import os 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) diff --git a/neutron/tests/unit/vmware/apiclient/__init__.py b/neutron/tests/unit/vmware/apiclient/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/neutron/tests/unit/nicira/test_nvp_api_common.py b/neutron/tests/unit/vmware/apiclient/test_api_common.py similarity index 96% rename from neutron/tests/unit/nicira/test_nvp_api_common.py rename to neutron/tests/unit/vmware/apiclient/test_api_common.py index 2943b7fa1..fde52abdc 100644 --- a/neutron/tests/unit/nicira/test_nvp_api_common.py +++ b/neutron/tests/unit/vmware/apiclient/test_api_common.py @@ -1,6 +1,6 @@ # 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 @@ -15,10 +15,8 @@ # 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 diff --git a/neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py b/neutron/tests/unit/vmware/apiclient/test_api_request_eventlet.py similarity index 98% rename from neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py rename to neutron/tests/unit/vmware/apiclient/test_api_request_eventlet.py index cbf75b0a4..cced00cc4 100644 --- a/neutron/tests/unit/nicira/test_nvp_api_request_eventlet.py +++ b/neutron/tests/unit/vmware/apiclient/test_api_request_eventlet.py @@ -1,6 +1,6 @@ # 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 @@ -27,11 +27,11 @@ from mock import patch 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 @@ -157,7 +157,6 @@ class NvpApiRequestEventletTest(base.BaseTestCase): 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) diff --git a/neutron/tests/unit/nicira/etc/fake_get_gwservice.json b/neutron/tests/unit/vmware/etc/fake_get_gwservice.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_gwservice.json rename to neutron/tests/unit/vmware/etc/fake_get_gwservice.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lqueue.json b/neutron/tests/unit/vmware/etc/fake_get_lqueue.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lqueue.json rename to neutron/tests/unit/vmware/etc/fake_get_lqueue.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lrouter.json b/neutron/tests/unit/vmware/etc/fake_get_lrouter.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lrouter.json rename to neutron/tests/unit/vmware/etc/fake_get_lrouter.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lrouter_lport.json b/neutron/tests/unit/vmware/etc/fake_get_lrouter_lport.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lrouter_lport.json rename to neutron/tests/unit/vmware/etc/fake_get_lrouter_lport.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json b/neutron/tests/unit/vmware/etc/fake_get_lrouter_lport_att.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lrouter_lport_att.json rename to neutron/tests/unit/vmware/etc/fake_get_lrouter_lport_att.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lrouter_nat.json b/neutron/tests/unit/vmware/etc/fake_get_lrouter_nat.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lrouter_nat.json rename to neutron/tests/unit/vmware/etc/fake_get_lrouter_nat.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lswitch.json b/neutron/tests/unit/vmware/etc/fake_get_lswitch.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lswitch.json rename to neutron/tests/unit/vmware/etc/fake_get_lswitch.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport.json b/neutron/tests/unit/vmware/etc/fake_get_lswitch_lport.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lswitch_lport.json rename to neutron/tests/unit/vmware/etc/fake_get_lswitch_lport.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json b/neutron/tests/unit/vmware/etc/fake_get_lswitch_lport_att.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_att.json rename to neutron/tests/unit/vmware/etc/fake_get_lswitch_lport_att.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json b/neutron/tests/unit/vmware/etc/fake_get_lswitch_lport_status.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_lswitch_lport_status.json rename to neutron/tests/unit/vmware/etc/fake_get_lswitch_lport_status.json diff --git a/neutron/tests/unit/nicira/etc/fake_get_security_profile.json b/neutron/tests/unit/vmware/etc/fake_get_security_profile.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_get_security_profile.json rename to neutron/tests/unit/vmware/etc/fake_get_security_profile.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_gwservice.json b/neutron/tests/unit/vmware/etc/fake_post_gwservice.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_gwservice.json rename to neutron/tests/unit/vmware/etc/fake_post_gwservice.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lqueue.json b/neutron/tests/unit/vmware/etc/fake_post_lqueue.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lqueue.json rename to neutron/tests/unit/vmware/etc/fake_post_lqueue.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lrouter.json b/neutron/tests/unit/vmware/etc/fake_post_lrouter.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lrouter.json rename to neutron/tests/unit/vmware/etc/fake_post_lrouter.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lrouter_lport.json b/neutron/tests/unit/vmware/etc/fake_post_lrouter_lport.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lrouter_lport.json rename to neutron/tests/unit/vmware/etc/fake_post_lrouter_lport.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lrouter_nat.json b/neutron/tests/unit/vmware/etc/fake_post_lrouter_nat.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lrouter_nat.json rename to neutron/tests/unit/vmware/etc/fake_post_lrouter_nat.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lswitch.json b/neutron/tests/unit/vmware/etc/fake_post_lswitch.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lswitch.json rename to neutron/tests/unit/vmware/etc/fake_post_lswitch.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_lswitch_lport.json b/neutron/tests/unit/vmware/etc/fake_post_lswitch_lport.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_lswitch_lport.json rename to neutron/tests/unit/vmware/etc/fake_post_lswitch_lport.json diff --git a/neutron/tests/unit/nicira/etc/fake_post_security_profile.json b/neutron/tests/unit/vmware/etc/fake_post_security_profile.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_post_security_profile.json rename to neutron/tests/unit/vmware/etc/fake_post_security_profile.json diff --git a/neutron/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json b/neutron/tests/unit/vmware/etc/fake_put_lrouter_lport_att.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_put_lrouter_lport_att.json rename to neutron/tests/unit/vmware/etc/fake_put_lrouter_lport_att.json diff --git a/neutron/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json b/neutron/tests/unit/vmware/etc/fake_put_lswitch_lport_att.json similarity index 100% rename from neutron/tests/unit/nicira/etc/fake_put_lswitch_lport_att.json rename to neutron/tests/unit/vmware/etc/fake_put_lswitch_lport_att.json diff --git a/neutron/tests/unit/nicira/etc/neutron.conf.test b/neutron/tests/unit/vmware/etc/neutron.conf.test similarity index 100% rename from neutron/tests/unit/nicira/etc/neutron.conf.test rename to neutron/tests/unit/vmware/etc/neutron.conf.test diff --git a/neutron/tests/unit/nicira/etc/nsx.ini.agentless.test b/neutron/tests/unit/vmware/etc/nsx.ini.agentless.test similarity index 100% rename from neutron/tests/unit/nicira/etc/nsx.ini.agentless.test rename to neutron/tests/unit/vmware/etc/nsx.ini.agentless.test diff --git a/neutron/tests/unit/nicira/etc/nsx.ini.basic.test b/neutron/tests/unit/vmware/etc/nsx.ini.basic.test similarity index 100% rename from neutron/tests/unit/nicira/etc/nsx.ini.basic.test rename to neutron/tests/unit/vmware/etc/nsx.ini.basic.test diff --git a/neutron/tests/unit/nicira/etc/nsx.ini.full.test b/neutron/tests/unit/vmware/etc/nsx.ini.full.test similarity index 100% rename from neutron/tests/unit/nicira/etc/nsx.ini.full.test rename to neutron/tests/unit/vmware/etc/nsx.ini.full.test diff --git a/neutron/tests/unit/nicira/etc/nsx.ini.test b/neutron/tests/unit/vmware/etc/nsx.ini.test similarity index 100% rename from neutron/tests/unit/nicira/etc/nsx.ini.test rename to neutron/tests/unit/vmware/etc/nsx.ini.test diff --git a/neutron/tests/unit/nicira/etc/nvp.ini.full.test b/neutron/tests/unit/vmware/etc/nvp.ini.full.test similarity index 100% rename from neutron/tests/unit/nicira/etc/nvp.ini.full.test rename to neutron/tests/unit/vmware/etc/nvp.ini.full.test diff --git a/neutron/tests/unit/nicira/etc/vcns.ini.test b/neutron/tests/unit/vmware/etc/vcns.ini.test similarity index 100% rename from neutron/tests/unit/nicira/etc/vcns.ini.test rename to neutron/tests/unit/vmware/etc/vcns.ini.test diff --git a/neutron/tests/unit/nicira/fake_nvpapiclient.py b/neutron/tests/unit/vmware/fake_nvpapiclient.py similarity index 100% rename from neutron/tests/unit/nicira/fake_nvpapiclient.py rename to neutron/tests/unit/vmware/fake_nvpapiclient.py diff --git a/neutron/tests/unit/vmware/nsxlib/__init__.py b/neutron/tests/unit/vmware/nsxlib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/neutron/tests/unit/nicira/nsxlib/base.py b/neutron/tests/unit/vmware/nsxlib/base.py similarity index 92% rename from neutron/tests/unit/nicira/nsxlib/base.py rename to neutron/tests/unit/vmware/nsxlib/base.py index 2fcf894e1..09ea48b9a 100644 --- a/neutron/tests/unit/nicira/nsxlib/base.py +++ b/neutron/tests/unit/vmware/nsxlib/base.py @@ -23,10 +23,10 @@ from neutron.plugins.nicira import nsx_cluster 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 @@ -36,7 +36,7 @@ class NsxlibTestCase(base.BaseTestCase): 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") @@ -70,7 +70,7 @@ class NsxlibNegativeBaseTestCase(base.BaseTestCase): 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 diff --git a/neutron/tests/unit/nicira/nsxlib/test_l2gateway.py b/neutron/tests/unit/vmware/nsxlib/test_l2gateway.py similarity index 99% rename from neutron/tests/unit/nicira/nsxlib/test_l2gateway.py rename to neutron/tests/unit/vmware/nsxlib/test_l2gateway.py index 6529b6a5f..c70efe146 100644 --- a/neutron/tests/unit/nicira/nsxlib/test_l2gateway.py +++ b/neutron/tests/unit/vmware/nsxlib/test_l2gateway.py @@ -17,8 +17,8 @@ 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 diff --git a/neutron/tests/unit/nicira/nsxlib/test_lsn.py b/neutron/tests/unit/vmware/nsxlib/test_lsn.py similarity index 100% rename from neutron/tests/unit/nicira/nsxlib/test_lsn.py rename to neutron/tests/unit/vmware/nsxlib/test_lsn.py diff --git a/neutron/tests/unit/nicira/nsxlib/test_queue.py b/neutron/tests/unit/vmware/nsxlib/test_queue.py similarity index 98% rename from neutron/tests/unit/nicira/nsxlib/test_queue.py rename to neutron/tests/unit/vmware/nsxlib/test_queue.py index afa70fc4b..c4fd5f125 100644 --- a/neutron/tests/unit/nicira/nsxlib/test_queue.py +++ b/neutron/tests/unit/vmware/nsxlib/test_queue.py @@ -19,7 +19,7 @@ import mock 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): diff --git a/neutron/tests/unit/nicira/nsxlib/test_router.py b/neutron/tests/unit/vmware/nsxlib/test_router.py similarity index 99% rename from neutron/tests/unit/nicira/nsxlib/test_router.py rename to neutron/tests/unit/vmware/nsxlib/test_router.py index ad2afeb38..daefab8fd 100644 --- a/neutron/tests/unit/nicira/nsxlib/test_router.py +++ b/neutron/tests/unit/vmware/nsxlib/test_router.py @@ -24,8 +24,8 @@ from neutron.plugins.nicira.nsxlib import router as routerlib 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 diff --git a/neutron/tests/unit/nicira/nsxlib/test_secgroup.py b/neutron/tests/unit/vmware/nsxlib/test_secgroup.py similarity index 99% rename from neutron/tests/unit/nicira/nsxlib/test_secgroup.py rename to neutron/tests/unit/vmware/nsxlib/test_secgroup.py index ca65da464..502815434 100644 --- a/neutron/tests/unit/nicira/nsxlib/test_secgroup.py +++ b/neutron/tests/unit/vmware/nsxlib/test_secgroup.py @@ -17,7 +17,7 @@ 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): diff --git a/neutron/tests/unit/nicira/nsxlib/test_switch.py b/neutron/tests/unit/vmware/nsxlib/test_switch.py similarity index 99% rename from neutron/tests/unit/nicira/nsxlib/test_switch.py rename to neutron/tests/unit/vmware/nsxlib/test_switch.py index 6ba1621a0..5e1a5aa3b 100644 --- a/neutron/tests/unit/nicira/nsxlib/test_switch.py +++ b/neutron/tests/unit/vmware/nsxlib/test_switch.py @@ -21,8 +21,8 @@ from neutron.common import constants 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 diff --git a/neutron/tests/unit/nicira/nsxlib/test_versioning.py b/neutron/tests/unit/vmware/nsxlib/test_versioning.py similarity index 100% rename from neutron/tests/unit/nicira/nsxlib/test_versioning.py rename to neutron/tests/unit/vmware/nsxlib/test_versioning.py diff --git a/neutron/tests/unit/nicira/test_agent_scheduler.py b/neutron/tests/unit/vmware/test_agent_scheduler.py similarity index 89% rename from neutron/tests/unit/nicira/test_agent_scheduler.py rename to neutron/tests/unit/vmware/test_agent_scheduler.py index 8442dfd5d..69cbcc6fa 100644 --- a/neutron/tests/unit/nicira/test_agent_scheduler.py +++ b/neutron/tests/unit/vmware/test_agent_scheduler.py @@ -22,12 +22,12 @@ from neutron.common import constants 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): @@ -38,7 +38,7 @@ 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') diff --git a/neutron/tests/unit/nicira/test_dhcpmeta.py b/neutron/tests/unit/vmware/test_dhcpmeta.py similarity index 100% rename from neutron/tests/unit/nicira/test_dhcpmeta.py rename to neutron/tests/unit/vmware/test_dhcpmeta.py diff --git a/neutron/tests/unit/nicira/test_edge_router.py b/neutron/tests/unit/vmware/test_edge_router.py similarity index 96% rename from neutron/tests/unit/nicira/test_edge_router.py rename to neutron/tests/unit/vmware/test_edge_router.py index 9f8bdb209..87139c105 100644 --- a/neutron/tests/unit/nicira/test_edge_router.py +++ b/neutron/tests/unit/vmware/test_edge_router.py @@ -29,12 +29,12 @@ from neutron.openstack.common import uuidutils 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 @@ -63,7 +63,7 @@ class ServiceRouterTestExtensionManager(object): return [] -class ServiceRouterTest(test_nicira_plugin.NiciraL3NatTest, +class ServiceRouterTest(test_nsx_plugin.NiciraL3NatTest, test_l3_plugin.L3NatTestCaseMixin): def vcns_patch(self): @@ -97,7 +97,7 @@ class ServiceRouterTest(test_nicira_plugin.NiciraL3NatTest, 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 @@ -158,7 +158,7 @@ class ServiceRouterTest(test_nicira_plugin.NiciraL3NatTest, class ServiceRouterTestCase(ServiceRouterTest, - test_nicira_plugin.TestNiciraL3NatTestCase): + test_nsx_plugin.TestNiciraL3NatTestCase): def test_router_create(self): name = 'router1' diff --git a/neutron/tests/unit/nicira/test_fwaas_plugin.py b/neutron/tests/unit/vmware/test_fwaas_plugin.py similarity index 99% rename from neutron/tests/unit/nicira/test_fwaas_plugin.py rename to neutron/tests/unit/vmware/test_fwaas_plugin.py index 1060321ab..9f0c226ae 100644 --- a/neutron/tests/unit/nicira/test_fwaas_plugin.py +++ b/neutron/tests/unit/vmware/test_fwaas_plugin.py @@ -27,13 +27,11 @@ from neutron import manager 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( diff --git a/neutron/tests/unit/nicira/test_lbaas_plugin.py b/neutron/tests/unit/vmware/test_lbaas_plugin.py similarity index 99% rename from neutron/tests/unit/nicira/test_lbaas_plugin.py rename to neutron/tests/unit/vmware/test_lbaas_plugin.py index 15618c54e..0c9cc8408 100644 --- a/neutron/tests/unit/nicira/test_lbaas_plugin.py +++ b/neutron/tests/unit/vmware/test_lbaas_plugin.py @@ -27,13 +27,11 @@ from neutron.extensions import loadbalancer as lb 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( diff --git a/neutron/tests/unit/nicira/test_maclearning.py b/neutron/tests/unit/vmware/test_maclearning.py similarity index 93% rename from neutron/tests/unit/nicira/test_maclearning.py rename to neutron/tests/unit/vmware/test_maclearning.py index 6057fb201..306430992 100644 --- a/neutron/tests/unit/nicira/test_maclearning.py +++ b/neutron/tests/unit/vmware/test_maclearning.py @@ -26,13 +26,13 @@ from neutron import context 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): @@ -59,7 +59,7 @@ class MacLearningDBTestCase(test_db_plugin.NeutronDbPluginV2TestCase): 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(): @@ -67,7 +67,7 @@ class MacLearningDBTestCase(test_db_plugin.NeutronDbPluginV2TestCase): 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') diff --git a/neutron/tests/unit/nicira/test_networkgw.py b/neutron/tests/unit/vmware/test_networkgw.py similarity index 100% rename from neutron/tests/unit/nicira/test_networkgw.py rename to neutron/tests/unit/vmware/test_networkgw.py diff --git a/neutron/tests/unit/nicira/test_nicira_db.py b/neutron/tests/unit/vmware/test_nsx_db.py similarity index 100% rename from neutron/tests/unit/nicira/test_nicira_db.py rename to neutron/tests/unit/vmware/test_nsx_db.py diff --git a/neutron/tests/unit/nicira/test_nvpopts.py b/neutron/tests/unit/vmware/test_nsx_opts.py similarity index 99% rename from neutron/tests/unit/nicira/test_nvpopts.py rename to neutron/tests/unit/vmware/test_nsx_opts.py index 1b4a5212d..4405082cf 100644 --- a/neutron/tests/unit/nicira/test_nvpopts.py +++ b/neutron/tests/unit/vmware/test_nsx_opts.py @@ -30,8 +30,8 @@ from neutron.plugins.nicira import nsx_cluster 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') diff --git a/neutron/tests/unit/nicira/test_nicira_plugin.py b/neutron/tests/unit/vmware/test_nsx_plugin.py similarity index 98% rename from neutron/tests/unit/nicira/test_nicira_plugin.py rename to neutron/tests/unit/vmware/test_nsx_plugin.py index 76dd62351..9f31d110b 100644 --- a/neutron/tests/unit/nicira/test_nicira_plugin.py +++ b/neutron/tests/unit/vmware/test_nsx_plugin.py @@ -51,13 +51,6 @@ from neutron.plugins.nicira import nsxlib 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 @@ -66,6 +59,13 @@ import neutron.tests.unit.test_extension_security_group as ext_sg 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 @@ -108,7 +108,7 @@ class NiciraPluginV2TestCase(test_plugin.NeutronDbPluginV2TestCase): 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') @@ -390,7 +390,7 @@ class NiciraPortSecurityTestCase(psec.PortSecurityDBTestCase): 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 @@ -423,7 +423,7 @@ class NiciraSecurityGroupsTestCase(ext_sg.SecurityGroupDBTestCase): 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 @@ -521,7 +521,7 @@ class NiciraL3NatTest(test_l3_plugin.L3BaseForIntTests, 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() @@ -1048,7 +1048,7 @@ class NvpQoSTestExtensionManager(object): 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) @@ -1460,7 +1460,7 @@ class TestNiciraNetworkGateway(NiciraPluginV2TestCase, 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) @@ -1559,7 +1559,7 @@ class TestNiciraNetworkGateway(NiciraPluginV2TestCase, 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): diff --git a/neutron/tests/unit/nicira/test_nvp_sync.py b/neutron/tests/unit/vmware/test_nsx_sync.py similarity index 98% rename from neutron/tests/unit/nicira/test_nvp_sync.py rename to neutron/tests/unit/vmware/test_nsx_sync.py index b332fbe75..652b32d8d 100644 --- a/neutron/tests/unit/nicira/test_nvp_sync.py +++ b/neutron/tests/unit/vmware/test_nsx_sync.py @@ -27,19 +27,18 @@ from neutron.common import config 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__) @@ -259,7 +258,7 @@ class NvpSyncTestCase(base.BaseTestCase): 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') @@ -288,7 +287,7 @@ class NvpSyncTestCase(base.BaseTestCase): '--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') diff --git a/neutron/tests/unit/nicira/test_nsx_utils.py b/neutron/tests/unit/vmware/test_nsx_utils.py similarity index 85% rename from neutron/tests/unit/nicira/test_nsx_utils.py rename to neutron/tests/unit/vmware/test_nsx_utils.py index 8c648908b..deebaa6c5 100644 --- a/neutron/tests/unit/nicira/test_nsx_utils.py +++ b/neutron/tests/unit/vmware/test_nsx_utils.py @@ -25,8 +25,8 @@ from neutron.plugins.nicira.common import utils 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): @@ -39,33 +39,33 @@ 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 @@ -107,8 +107,8 @@ class NsxUtilsTestCase(base.BaseTestCase): 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': { @@ -123,8 +123,8 @@ class NsxUtilsTestCase(base.BaseTestCase): 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': { @@ -137,8 +137,8 @@ class NsxUtilsTestCase(base.BaseTestCase): # 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) @@ -154,8 +154,8 @@ class NsxUtilsTestCase(base.BaseTestCase): # 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) @@ -164,8 +164,8 @@ class NsxUtilsTestCase(base.BaseTestCase): # 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) @@ -181,8 +181,8 @@ class NsxUtilsTestCase(base.BaseTestCase): # 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) @@ -190,8 +190,8 @@ class NsxUtilsTestCase(base.BaseTestCase): # 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) diff --git a/neutron/tests/unit/nicira/test_vcns_driver.py b/neutron/tests/unit/vmware/test_vcns_driver.py similarity index 99% rename from neutron/tests/unit/nicira/test_vcns_driver.py rename to neutron/tests/unit/vmware/test_vcns_driver.py index 952fdff97..9ed11466d 100644 --- a/neutron/tests/unit/nicira/test_vcns_driver.py +++ b/neutron/tests/unit/vmware/test_vcns_driver.py @@ -27,9 +27,9 @@ from neutron.plugins.nicira.vshield.tasks.constants import TaskStatus 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") diff --git a/neutron/tests/unit/nicira/vshield/__init__.py b/neutron/tests/unit/vmware/vshield/__init__.py similarity index 100% rename from neutron/tests/unit/nicira/vshield/__init__.py rename to neutron/tests/unit/vmware/vshield/__init__.py diff --git a/neutron/tests/unit/nicira/vshield/fake_vcns.py b/neutron/tests/unit/vmware/vshield/fake_vcns.py similarity index 100% rename from neutron/tests/unit/nicira/vshield/fake_vcns.py rename to neutron/tests/unit/vmware/vshield/fake_vcns.py diff --git a/neutron/tests/unit/nicira/vshield/test_firewall_driver.py b/neutron/tests/unit/vmware/vshield/test_firewall_driver.py similarity index 99% rename from neutron/tests/unit/nicira/vshield/test_firewall_driver.py rename to neutron/tests/unit/vmware/vshield/test_firewall_driver.py index 26705dd3c..cd6764b81 100644 --- a/neutron/tests/unit/nicira/vshield/test_firewall_driver.py +++ b/neutron/tests/unit/vmware/vshield/test_firewall_driver.py @@ -27,9 +27,9 @@ from neutron.openstack.common import uuidutils 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 diff --git a/neutron/tests/unit/nicira/vshield/test_loadbalancer_driver.py b/neutron/tests/unit/vmware/vshield/test_loadbalancer_driver.py similarity index 98% rename from neutron/tests/unit/nicira/vshield/test_loadbalancer_driver.py rename to neutron/tests/unit/vmware/vshield/test_loadbalancer_driver.py index 40a3d5cca..ff5ba692d 100644 --- a/neutron/tests/unit/nicira/vshield/test_loadbalancer_driver.py +++ b/neutron/tests/unit/vmware/vshield/test_loadbalancer_driver.py @@ -27,9 +27,9 @@ from neutron.plugins.nicira.vshield import ( 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 diff --git a/setup.cfg b/setup.cfg index 839159fb9..27f70b6e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -136,6 +136,7 @@ neutron.core_plugins = 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 -- 2.45.2