From c56918027afe72095353b94cab39f411c274d650 Mon Sep 17 00:00:00 2001 From: Daniel Mellado Date: Fri, 29 Jan 2016 11:30:25 +0000 Subject: [PATCH] Use tempest plugin interface Make use of the Tempest plugin interface instead of copying Neutron files into Tempest. This will remove the burden to port Neutron tests onto Tempest master recurrently. It uses neutron/tests/tempest/ as new top folder for all Tempest tests. It follows the model of Heat [1]. [1]: https://github.com/openstack/heat/tree/master/heat_integrationtests Partially implements bp external-plugin-interface Change-Id: Ia233aa162746845f6ae08a8157dcd242dcd58eab --- TESTING.rst | 9 +++-- doc/source/devref/quality_of_service.rst | 2 +- neutron/tests/tempest/README.rst | 6 ++-- neutron/tests/{ => tempest}/api/__init__.py | 0 .../tests/{ => tempest}/api/admin/__init__.py | 0 .../api/admin/test_agent_management.py | 2 +- .../api/admin/test_dhcp_agent_scheduler.py | 2 +- ...st_extension_driver_port_security_admin.py | 4 +-- .../admin/test_external_network_extension.py | 2 +- .../admin/test_floating_ips_admin_actions.py | 2 +- .../api/admin/test_l3_agent_scheduler.py | 2 +- .../{ => tempest}/api/admin/test_quotas.py | 2 +- .../api/admin/test_routers_dvr.py | 2 +- .../admin/test_shared_network_extension.py | 2 +- neutron/tests/{ => tempest}/api/base.py | 2 +- .../tests/{ => tempest}/api/base_routers.py | 2 +- .../{ => tempest}/api/base_security_groups.py | 2 +- neutron/tests/{ => tempest}/api/clients.py | 0 .../{ => tempest}/api/test_address_scopes.py | 2 +- .../api/test_address_scopes_negative.py | 2 +- .../api/test_allowed_address_pair.py | 2 +- .../api/test_auto_allocated_topology.py | 2 +- .../api/test_bgp_speaker_extensions.py | 2 +- .../test_bgp_speaker_extensions_negative.py | 2 +- .../tests/{ => tempest}/api/test_dhcp_ipv6.py | 2 +- .../test_extension_driver_port_security.py | 4 +-- .../api/test_extra_dhcp_options.py | 2 +- .../api/test_flavors_extensions.py | 2 +- .../{ => tempest}/api/test_floating_ips.py | 2 +- .../api/test_floating_ips_negative.py | 2 +- .../api/test_metering_extensions.py | 2 +- .../api/test_network_ip_availability.py | 2 +- .../tests/{ => tempest}/api/test_networks.py | 2 +- neutron/tests/{ => tempest}/api/test_ports.py | 2 +- neutron/tests/{ => tempest}/api/test_qos.py | 2 +- .../tests/{ => tempest}/api/test_routers.py | 2 +- .../api/test_routers_negative.py | 2 +- .../{ => tempest}/api/test_security_groups.py | 2 +- .../api/test_security_groups_negative.py | 2 +- .../api/test_service_type_management.py | 2 +- .../{ => tempest}/api/test_subnetpools.py | 2 +- .../api/test_subnetpools_negative.py | 2 +- .../tests/{ => tempest}/api/test_timestamp.py | 2 +- neutron/tests/tempest/plugin.py | 36 +++++++++++++++++++ neutron/tests/tempest/scenario/__init__.py | 0 setup.cfg | 2 ++ tox.ini | 2 +- 47 files changed, 89 insertions(+), 46 deletions(-) rename neutron/tests/{ => tempest}/api/__init__.py (100%) rename neutron/tests/{ => tempest}/api/admin/__init__.py (100%) rename neutron/tests/{ => tempest}/api/admin/test_agent_management.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_dhcp_agent_scheduler.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_extension_driver_port_security_admin.py (91%) rename neutron/tests/{ => tempest}/api/admin/test_external_network_extension.py (99%) rename neutron/tests/{ => tempest}/api/admin/test_floating_ips_admin_actions.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_l3_agent_scheduler.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_quotas.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_routers_dvr.py (98%) rename neutron/tests/{ => tempest}/api/admin/test_shared_network_extension.py (99%) rename neutron/tests/{ => tempest}/api/base.py (99%) rename neutron/tests/{ => tempest}/api/base_routers.py (97%) rename neutron/tests/{ => tempest}/api/base_security_groups.py (97%) rename neutron/tests/{ => tempest}/api/clients.py (100%) rename neutron/tests/{ => tempest}/api/test_address_scopes.py (99%) rename neutron/tests/{ => tempest}/api/test_address_scopes_negative.py (98%) rename neutron/tests/{ => tempest}/api/test_allowed_address_pair.py (99%) rename neutron/tests/{ => tempest}/api/test_auto_allocated_topology.py (98%) rename neutron/tests/{ => tempest}/api/test_bgp_speaker_extensions.py (99%) rename neutron/tests/{ => tempest}/api/test_bgp_speaker_extensions_negative.py (98%) rename neutron/tests/{ => tempest}/api/test_dhcp_ipv6.py (98%) rename neutron/tests/{ => tempest}/api/test_extension_driver_port_security.py (98%) rename neutron/tests/{ => tempest}/api/test_extra_dhcp_options.py (98%) rename neutron/tests/{ => tempest}/api/test_flavors_extensions.py (99%) rename neutron/tests/{ => tempest}/api/test_floating_ips.py (98%) rename neutron/tests/{ => tempest}/api/test_floating_ips_negative.py (98%) rename neutron/tests/{ => tempest}/api/test_metering_extensions.py (99%) rename neutron/tests/{ => tempest}/api/test_network_ip_availability.py (99%) rename neutron/tests/{ => tempest}/api/test_networks.py (98%) rename neutron/tests/{ => tempest}/api/test_ports.py (97%) rename neutron/tests/{ => tempest}/api/test_qos.py (99%) rename neutron/tests/{ => tempest}/api/test_routers.py (99%) rename neutron/tests/{ => tempest}/api/test_routers_negative.py (96%) rename neutron/tests/{ => tempest}/api/test_security_groups.py (97%) rename neutron/tests/{ => tempest}/api/test_security_groups_negative.py (97%) rename neutron/tests/{ => tempest}/api/test_service_type_management.py (96%) rename neutron/tests/{ => tempest}/api/test_subnetpools.py (99%) rename neutron/tests/{ => tempest}/api/test_subnetpools_negative.py (99%) rename neutron/tests/{ => tempest}/api/test_timestamp.py (99%) create mode 100644 neutron/tests/tempest/plugin.py create mode 100644 neutron/tests/tempest/scenario/__init__.py diff --git a/TESTING.rst b/TESTING.rst index e7d424096ee..c73003a4525 100644 --- a/TESTING.rst +++ b/TESTING.rst @@ -283,7 +283,7 @@ the hypervisor appropriately. API Tests ~~~~~~~~~ -API tests (neutron/tests/api/) are intended to ensure the function +API tests (neutron/tests/tempest/api/) are intended to ensure the function and stability of the Neutron API. As much as possible, changes to this path should not be made at the same time as changes to the code to limit the potential for introducing backwards-incompatible changes, @@ -297,7 +297,7 @@ be made about implementation. Only the contract defined by Neutron's REST API should be validated, and all interaction with the daemon should be via a REST client. -neutron/tests/api was copied from the Tempest project. At the time, there was +neutron/tests/tempest/api was copied from the Tempest project. At the time, there was an overlap of tests between the Tempest and Neutron repositories. This overlap was then eliminated by carving out a subset of resources that belong to Tempest, with the rest in Neutron. @@ -525,6 +525,11 @@ TEMPEST_CONFIG_DIR before invoking tox: :: export TEMPEST_CONFIG_DIR=[path to dir containing tempest.conf] tox -e api +You may also utilize Neutron's Tempest plugin by going to the Tempest directory +and executing: + +tox -e all-plugin neutron + Running Individual Tests ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/devref/quality_of_service.rst b/doc/source/devref/quality_of_service.rst index c7ff2a67824..f063d5999ab 100644 --- a/doc/source/devref/quality_of_service.rst +++ b/doc/source/devref/quality_of_service.rst @@ -412,4 +412,4 @@ API tests API tests for basic CRUD operations for ports, networks, policies, and rules were added in: -* neutron.tests.api.test_qos +* neutron.tests.tempest.api.test_qos diff --git a/neutron/tests/tempest/README.rst b/neutron/tests/tempest/README.rst index 05ea9989bfb..d61e72cf33a 100644 --- a/neutron/tests/tempest/README.rst +++ b/neutron/tests/tempest/README.rst @@ -3,8 +3,8 @@ WARNING The files under this path were copied from tempest as part of the move of the api tests, and they will be removed as required over time to -minimize the depedency on the tempest testing framework. -While it exists, only neutron.tests.api and neutron.tests.retargetable should -be importing files from this path. neutron.tests.tempest.config uses +minimize the dependency on the tempest testing framework. +While it exists, only neutron.tests.tempest.api and neutron.tests.retargetable +should be importing files from this path. neutron.tests.tempest.config uses the global cfg.CONF instance and importing it outside of the api tests has the potential to break Neutron's use of cfg.CONF. diff --git a/neutron/tests/api/__init__.py b/neutron/tests/tempest/api/__init__.py similarity index 100% rename from neutron/tests/api/__init__.py rename to neutron/tests/tempest/api/__init__.py diff --git a/neutron/tests/api/admin/__init__.py b/neutron/tests/tempest/api/admin/__init__.py similarity index 100% rename from neutron/tests/api/admin/__init__.py rename to neutron/tests/tempest/api/admin/__init__.py diff --git a/neutron/tests/api/admin/test_agent_management.py b/neutron/tests/tempest/api/admin/test_agent_management.py similarity index 98% rename from neutron/tests/api/admin/test_agent_management.py rename to neutron/tests/tempest/api/admin/test_agent_management.py index b5150968528..4e95391fafb 100644 --- a/neutron/tests/api/admin/test_agent_management.py +++ b/neutron/tests/tempest/api/admin/test_agent_management.py @@ -15,7 +15,7 @@ from neutron.tests.tempest.common import tempest_fixtures from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class AgentManagementTestJSON(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/admin/test_dhcp_agent_scheduler.py b/neutron/tests/tempest/api/admin/test_dhcp_agent_scheduler.py similarity index 98% rename from neutron/tests/api/admin/test_dhcp_agent_scheduler.py rename to neutron/tests/tempest/api/admin/test_dhcp_agent_scheduler.py index b3e7c4fb5cf..049afe5ce4c 100644 --- a/neutron/tests/api/admin/test_dhcp_agent_scheduler.py +++ b/neutron/tests/tempest/api/admin/test_dhcp_agent_scheduler.py @@ -14,7 +14,7 @@ from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/admin/test_extension_driver_port_security_admin.py b/neutron/tests/tempest/api/admin/test_extension_driver_port_security_admin.py similarity index 91% rename from neutron/tests/api/admin/test_extension_driver_port_security_admin.py rename to neutron/tests/tempest/api/admin/test_extension_driver_port_security_admin.py index db9627f59a9..1f602aeaf3a 100644 --- a/neutron/tests/api/admin/test_extension_driver_port_security_admin.py +++ b/neutron/tests/tempest/api/admin/test_extension_driver_port_security_admin.py @@ -16,8 +16,8 @@ from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base -from neutron.tests.api import base_security_groups as base_security +from neutron.tests.tempest.api import base +from neutron.tests.tempest.api import base_security_groups as base_security class PortSecurityAdminTests(base_security.BaseSecGroupTest, diff --git a/neutron/tests/api/admin/test_external_network_extension.py b/neutron/tests/tempest/api/admin/test_external_network_extension.py similarity index 99% rename from neutron/tests/api/admin/test_external_network_extension.py rename to neutron/tests/tempest/api/admin/test_external_network_extension.py index c09514a5ac6..5403ad0ce87 100644 --- a/neutron/tests/api/admin/test_external_network_extension.py +++ b/neutron/tests/tempest/api/admin/test_external_network_extension.py @@ -16,7 +16,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test import testtools -from neutron.tests.api import base +from neutron.tests.tempest.api import base class ExternalNetworksRBACTestJSON(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/admin/test_floating_ips_admin_actions.py b/neutron/tests/tempest/api/admin/test_floating_ips_admin_actions.py similarity index 98% rename from neutron/tests/api/admin/test_floating_ips_admin_actions.py rename to neutron/tests/tempest/api/admin/test_floating_ips_admin_actions.py index d9043517a83..b8512ad62c1 100644 --- a/neutron/tests/api/admin/test_floating_ips_admin_actions.py +++ b/neutron/tests/tempest/api/admin/test_floating_ips_admin_actions.py @@ -18,7 +18,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test import testtools -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/admin/test_l3_agent_scheduler.py b/neutron/tests/tempest/api/admin/test_l3_agent_scheduler.py similarity index 98% rename from neutron/tests/api/admin/test_l3_agent_scheduler.py rename to neutron/tests/tempest/api/admin/test_l3_agent_scheduler.py index cf224a5c918..de09ba17264 100644 --- a/neutron/tests/api/admin/test_l3_agent_scheduler.py +++ b/neutron/tests/tempest/api/admin/test_l3_agent_scheduler.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import exceptions AGENT_TYPE = 'L3 agent' diff --git a/neutron/tests/api/admin/test_quotas.py b/neutron/tests/tempest/api/admin/test_quotas.py similarity index 98% rename from neutron/tests/api/admin/test_quotas.py rename to neutron/tests/tempest/api/admin/test_quotas.py index 0beee5ae4ad..94471e12aa7 100644 --- a/neutron/tests/api/admin/test_quotas.py +++ b/neutron/tests/tempest/api/admin/test_quotas.py @@ -17,7 +17,7 @@ import six from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class QuotasTest(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/admin/test_routers_dvr.py b/neutron/tests/tempest/api/admin/test_routers_dvr.py similarity index 98% rename from neutron/tests/api/admin/test_routers_dvr.py rename to neutron/tests/tempest/api/admin/test_routers_dvr.py index fc57c717826..ff429b8f260 100644 --- a/neutron/tests/api/admin/test_routers_dvr.py +++ b/neutron/tests/tempest/api/admin/test_routers_dvr.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base_routers as base +from neutron.tests.tempest.api import base_routers as base class RoutersTestDVR(base.BaseRouterTest): diff --git a/neutron/tests/api/admin/test_shared_network_extension.py b/neutron/tests/tempest/api/admin/test_shared_network_extension.py similarity index 99% rename from neutron/tests/api/admin/test_shared_network_extension.py rename to neutron/tests/tempest/api/admin/test_shared_network_extension.py index f73055f6bda..4c7bf6a9f05 100644 --- a/neutron/tests/api/admin/test_shared_network_extension.py +++ b/neutron/tests/tempest/api/admin/test_shared_network_extension.py @@ -21,7 +21,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test import testtools -from neutron.tests.api import base +from neutron.tests.tempest.api import base class SharedNetworksTest(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/base.py b/neutron/tests/tempest/api/base.py similarity index 99% rename from neutron/tests/api/base.py rename to neutron/tests/tempest/api/base.py index b56d915db16..c1bd6229531 100644 --- a/neutron/tests/api/base.py +++ b/neutron/tests/tempest/api/base.py @@ -18,7 +18,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import clients +from neutron.tests.tempest.api import clients from neutron.tests.tempest import config from neutron.tests.tempest import exceptions diff --git a/neutron/tests/api/base_routers.py b/neutron/tests/tempest/api/base_routers.py similarity index 97% rename from neutron/tests/api/base_routers.py rename to neutron/tests/tempest/api/base_routers.py index 95ffa1411f5..8b0b5a47705 100644 --- a/neutron/tests/api/base_routers.py +++ b/neutron/tests/tempest/api/base_routers.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.tests.api import base +from neutron.tests.tempest.api import base class BaseRouterTest(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/base_security_groups.py b/neutron/tests/tempest/api/base_security_groups.py similarity index 97% rename from neutron/tests/api/base_security_groups.py rename to neutron/tests/tempest/api/base_security_groups.py index c6fb42dbe86..8575ba974b2 100644 --- a/neutron/tests/api/base_security_groups.py +++ b/neutron/tests/tempest/api/base_security_groups.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils -from neutron.tests.api import base +from neutron.tests.tempest.api import base class BaseSecGroupTest(base.BaseNetworkTest): diff --git a/neutron/tests/api/clients.py b/neutron/tests/tempest/api/clients.py similarity index 100% rename from neutron/tests/api/clients.py rename to neutron/tests/tempest/api/clients.py diff --git a/neutron/tests/api/test_address_scopes.py b/neutron/tests/tempest/api/test_address_scopes.py similarity index 99% rename from neutron/tests/api/test_address_scopes.py rename to neutron/tests/tempest/api/test_address_scopes.py index c484b40782e..aedc5525606 100644 --- a/neutron/tests/api/test_address_scopes.py +++ b/neutron/tests/tempest/api/test_address_scopes.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base ADDRESS_SCOPE_NAME = 'smoke-address-scope' diff --git a/neutron/tests/api/test_address_scopes_negative.py b/neutron/tests/tempest/api/test_address_scopes_negative.py similarity index 98% rename from neutron/tests/api/test_address_scopes_negative.py rename to neutron/tests/tempest/api/test_address_scopes_negative.py index d2f1f23fbd6..9fc9e5bb6dd 100644 --- a/neutron/tests/api/test_address_scopes_negative.py +++ b/neutron/tests/tempest/api/test_address_scopes_negative.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import test_address_scopes +from neutron.tests.tempest.api import test_address_scopes class AddressScopeTestNegative(test_address_scopes.AddressScopeTestBase): diff --git a/neutron/tests/api/test_allowed_address_pair.py b/neutron/tests/tempest/api/test_allowed_address_pair.py similarity index 99% rename from neutron/tests/api/test_allowed_address_pair.py rename to neutron/tests/tempest/api/test_allowed_address_pair.py index 500c58c0b8f..f6db86e4e7b 100644 --- a/neutron/tests/api/test_allowed_address_pair.py +++ b/neutron/tests/tempest/api/test_allowed_address_pair.py @@ -16,7 +16,7 @@ import netaddr from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_auto_allocated_topology.py b/neutron/tests/tempest/api/test_auto_allocated_topology.py similarity index 98% rename from neutron/tests/api/test_auto_allocated_topology.py rename to neutron/tests/tempest/api/test_auto_allocated_topology.py index a8c5200b7d5..d9c59c3715f 100644 --- a/neutron/tests/api/test_auto_allocated_topology.py +++ b/neutron/tests/tempest/api/test_auto_allocated_topology.py @@ -16,7 +16,7 @@ from oslo_config import cfg from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class TestAutoAllocatedTopology(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/test_bgp_speaker_extensions.py b/neutron/tests/tempest/api/test_bgp_speaker_extensions.py similarity index 99% rename from neutron/tests/api/test_bgp_speaker_extensions.py rename to neutron/tests/tempest/api/test_bgp_speaker_extensions.py index fc059aa9b2e..123f43fe2da 100644 --- a/neutron/tests/api/test_bgp_speaker_extensions.py +++ b/neutron/tests/tempest/api/test_bgp_speaker_extensions.py @@ -18,7 +18,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test import testtools -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest.common import tempest_fixtures as fixtures CONF = config.CONF diff --git a/neutron/tests/api/test_bgp_speaker_extensions_negative.py b/neutron/tests/tempest/api/test_bgp_speaker_extensions_negative.py similarity index 98% rename from neutron/tests/api/test_bgp_speaker_extensions_negative.py rename to neutron/tests/tempest/api/test_bgp_speaker_extensions_negative.py index a230e0a891c..d0b7d1eb537 100644 --- a/neutron/tests/api/test_bgp_speaker_extensions_negative.py +++ b/neutron/tests/tempest/api/test_bgp_speaker_extensions_negative.py @@ -15,7 +15,7 @@ import netaddr from tempest.lib import exceptions as lib_exc -from neutron.tests.api import test_bgp_speaker_extensions as test_base +from neutron.tests.tempest.api import test_bgp_speaker_extensions as test_base from tempest import test diff --git a/neutron/tests/api/test_dhcp_ipv6.py b/neutron/tests/tempest/api/test_dhcp_ipv6.py similarity index 98% rename from neutron/tests/api/test_dhcp_ipv6.py rename to neutron/tests/tempest/api/test_dhcp_ipv6.py index 9682a633d25..e136efa7655 100644 --- a/neutron/tests/api/test_dhcp_ipv6.py +++ b/neutron/tests/tempest/api/test_dhcp_ipv6.py @@ -18,7 +18,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test from neutron.common import constants -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_extension_driver_port_security.py b/neutron/tests/tempest/api/test_extension_driver_port_security.py similarity index 98% rename from neutron/tests/api/test_extension_driver_port_security.py rename to neutron/tests/tempest/api/test_extension_driver_port_security.py index 7880fb78a3e..ce292605ba7 100644 --- a/neutron/tests/api/test_extension_driver_port_security.py +++ b/neutron/tests/tempest/api/test_extension_driver_port_security.py @@ -17,8 +17,8 @@ import ddt from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base -from neutron.tests.api import base_security_groups as base_security +from neutron.tests.tempest.api import base +from neutron.tests.tempest.api import base_security_groups as base_security FAKE_IP = '10.0.0.1' FAKE_MAC = '00:25:64:e8:19:dd' diff --git a/neutron/tests/api/test_extra_dhcp_options.py b/neutron/tests/tempest/api/test_extra_dhcp_options.py similarity index 98% rename from neutron/tests/api/test_extra_dhcp_options.py rename to neutron/tests/tempest/api/test_extra_dhcp_options.py index 38586fa7ed3..a51ad27dcf0 100644 --- a/neutron/tests/api/test_extra_dhcp_options.py +++ b/neutron/tests/tempest/api/test_extra_dhcp_options.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest): diff --git a/neutron/tests/api/test_flavors_extensions.py b/neutron/tests/tempest/api/test_flavors_extensions.py similarity index 99% rename from neutron/tests/api/test_flavors_extensions.py rename to neutron/tests/tempest/api/test_flavors_extensions.py index f0ec24566d4..063d5030c77 100644 --- a/neutron/tests/api/test_flavors_extensions.py +++ b/neutron/tests/tempest/api/test_flavors_extensions.py @@ -15,7 +15,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class TestFlavorsJson(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/test_floating_ips.py b/neutron/tests/tempest/api/test_floating_ips.py similarity index 98% rename from neutron/tests/api/test_floating_ips.py rename to neutron/tests/tempest/api/test_floating_ips.py index 433d1ea9d1c..dd644482de0 100644 --- a/neutron/tests/api/test_floating_ips.py +++ b/neutron/tests/tempest/api/test_floating_ips.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_floating_ips_negative.py b/neutron/tests/tempest/api/test_floating_ips_negative.py similarity index 98% rename from neutron/tests/api/test_floating_ips_negative.py rename to neutron/tests/tempest/api/test_floating_ips_negative.py index e3ea90ae9ef..700fa100749 100644 --- a/neutron/tests/api/test_floating_ips_negative.py +++ b/neutron/tests/tempest/api/test_floating_ips_negative.py @@ -18,7 +18,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_metering_extensions.py b/neutron/tests/tempest/api/test_metering_extensions.py similarity index 99% rename from neutron/tests/api/test_metering_extensions.py rename to neutron/tests/tempest/api/test_metering_extensions.py index 94186c269e9..3ef55dbc0a9 100644 --- a/neutron/tests/api/test_metering_extensions.py +++ b/neutron/tests/tempest/api/test_metering_extensions.py @@ -15,7 +15,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class MeteringTestJSON(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/test_network_ip_availability.py b/neutron/tests/tempest/api/test_network_ip_availability.py similarity index 99% rename from neutron/tests/api/test_network_ip_availability.py rename to neutron/tests/tempest/api/test_network_ip_availability.py index 7f8e243991f..2976da00b77 100644 --- a/neutron/tests/api/test_network_ip_availability.py +++ b/neutron/tests/tempest/api/test_network_ip_availability.py @@ -19,7 +19,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config from neutron_lib import constants as lib_constants diff --git a/neutron/tests/api/test_networks.py b/neutron/tests/tempest/api/test_networks.py similarity index 98% rename from neutron/tests/api/test_networks.py rename to neutron/tests/tempest/api/test_networks.py index fd90c562ba8..7a315db56aa 100644 --- a/neutron/tests/api/test_networks.py +++ b/neutron/tests/tempest/api/test_networks.py @@ -15,7 +15,7 @@ from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_ports.py b/neutron/tests/tempest/api/test_ports.py similarity index 97% rename from neutron/tests/api/test_ports.py rename to neutron/tests/tempest/api/test_ports.py index 9b495305dfb..23db50b8b88 100644 --- a/neutron/tests/api/test_ports.py +++ b/neutron/tests/tempest/api/test_ports.py @@ -15,7 +15,7 @@ from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class PortsTestJSON(base.BaseNetworkTest): diff --git a/neutron/tests/api/test_qos.py b/neutron/tests/tempest/api/test_qos.py similarity index 99% rename from neutron/tests/api/test_qos.py rename to neutron/tests/tempest/api/test_qos.py index afca9d9cbc8..e8a8686b9f0 100644 --- a/neutron/tests/api/test_qos.py +++ b/neutron/tests/tempest/api/test_qos.py @@ -19,7 +19,7 @@ from tempest import test import testtools from neutron.services.qos import qos_consts -from neutron.tests.api import base +from neutron.tests.tempest.api import base class QosTestJSON(base.BaseAdminNetworkTest): diff --git a/neutron/tests/api/test_routers.py b/neutron/tests/tempest/api/test_routers.py similarity index 99% rename from neutron/tests/api/test_routers.py rename to neutron/tests/tempest/api/test_routers.py index bc041655d1d..6acf259c3ac 100644 --- a/neutron/tests/api/test_routers.py +++ b/neutron/tests/tempest/api/test_routers.py @@ -18,7 +18,7 @@ import six from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base_routers as base +from neutron.tests.tempest.api import base_routers as base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_routers_negative.py b/neutron/tests/tempest/api/test_routers_negative.py similarity index 96% rename from neutron/tests/api/test_routers_negative.py rename to neutron/tests/tempest/api/test_routers_negative.py index d043bc0eb78..c5617a0b9bb 100644 --- a/neutron/tests/api/test_routers_negative.py +++ b/neutron/tests/tempest/api/test_routers_negative.py @@ -18,7 +18,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test import testtools -from neutron.tests.api import base_routers as base +from neutron.tests.tempest.api import base_routers as base class DvrRoutersNegativeTest(base.BaseRouterTest): diff --git a/neutron/tests/api/test_security_groups.py b/neutron/tests/tempest/api/test_security_groups.py similarity index 97% rename from neutron/tests/api/test_security_groups.py rename to neutron/tests/tempest/api/test_security_groups.py index 994f9eb6119..49cd1c26934 100644 --- a/neutron/tests/api/test_security_groups.py +++ b/neutron/tests/tempest/api/test_security_groups.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base_security_groups as base +from neutron.tests.tempest.api import base_security_groups as base class SecGroupTest(base.BaseSecGroupTest): diff --git a/neutron/tests/api/test_security_groups_negative.py b/neutron/tests/tempest/api/test_security_groups_negative.py similarity index 97% rename from neutron/tests/api/test_security_groups_negative.py rename to neutron/tests/tempest/api/test_security_groups_negative.py index 4e295d0fe22..b06601d195b 100644 --- a/neutron/tests/api/test_security_groups_negative.py +++ b/neutron/tests/tempest/api/test_security_groups_negative.py @@ -16,7 +16,7 @@ from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import base_security_groups as base +from neutron.tests.tempest.api import base_security_groups as base from neutron.tests.tempest import config CONF = config.CONF diff --git a/neutron/tests/api/test_service_type_management.py b/neutron/tests/tempest/api/test_service_type_management.py similarity index 96% rename from neutron/tests/api/test_service_type_management.py rename to neutron/tests/tempest/api/test_service_type_management.py index 1374d3e88a1..71c8f5cedd3 100644 --- a/neutron/tests/api/test_service_type_management.py +++ b/neutron/tests/tempest/api/test_service_type_management.py @@ -12,7 +12,7 @@ from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class ServiceTypeManagementTest(base.BaseNetworkTest): diff --git a/neutron/tests/api/test_subnetpools.py b/neutron/tests/tempest/api/test_subnetpools.py similarity index 99% rename from neutron/tests/api/test_subnetpools.py rename to neutron/tests/tempest/api/test_subnetpools.py index 4066a5a1b88..a6c48b9653f 100644 --- a/neutron/tests/api/test_subnetpools.py +++ b/neutron/tests/tempest/api/test_subnetpools.py @@ -16,7 +16,7 @@ from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base SUBNETPOOL_NAME = 'smoke-subnetpool' SUBNET_NAME = 'smoke-subnet' diff --git a/neutron/tests/api/test_subnetpools_negative.py b/neutron/tests/tempest/api/test_subnetpools_negative.py similarity index 99% rename from neutron/tests/api/test_subnetpools_negative.py rename to neutron/tests/tempest/api/test_subnetpools_negative.py index 2f4b46ffcdc..713ef3255a8 100644 --- a/neutron/tests/api/test_subnetpools_negative.py +++ b/neutron/tests/tempest/api/test_subnetpools_negative.py @@ -20,7 +20,7 @@ from tempest.lib.common.utils import data_utils from tempest.lib import exceptions as lib_exc from tempest import test -from neutron.tests.api import test_subnetpools +from neutron.tests.tempest.api import test_subnetpools SUBNETPOOL_NAME = 'smoke-subnetpool' diff --git a/neutron/tests/api/test_timestamp.py b/neutron/tests/tempest/api/test_timestamp.py similarity index 99% rename from neutron/tests/api/test_timestamp.py rename to neutron/tests/tempest/api/test_timestamp.py index 30fb395e61b..6c36cf616b2 100644 --- a/neutron/tests/api/test_timestamp.py +++ b/neutron/tests/tempest/api/test_timestamp.py @@ -15,7 +15,7 @@ import copy from tempest.lib.common.utils import data_utils from tempest import test -from neutron.tests.api import base +from neutron.tests.tempest.api import base class TestTimeStamp(base.BaseAdminNetworkTest): diff --git a/neutron/tests/tempest/plugin.py b/neutron/tests/tempest/plugin.py new file mode 100644 index 00000000000..e583b282b54 --- /dev/null +++ b/neutron/tests/tempest/plugin.py @@ -0,0 +1,36 @@ +# Copyright 2015 +# 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 +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# 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 os + +from tempest import config +from tempest.test_discover import plugins + +import neutron + +class NeutronTempestPlugin(plugins.TempestPlugin): + def load_tests(self): + base_path = os.path.split(os.path.dirname( + os.path.abspath(neutron.__file__)))[0] + test_dir = "neutron/tests/tempest" + full_test_dir = os.path.join(base_path, test_dir) + return full_test_dir, base_path + + def register_opts(self, conf): + pass + + def get_opt_lists(self): + pass diff --git a/neutron/tests/tempest/scenario/__init__.py b/neutron/tests/tempest/scenario/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/setup.cfg b/setup.cfg index 4c422de7a0f..88383d146df 100644 --- a/setup.cfg +++ b/setup.cfg @@ -163,6 +163,8 @@ neutron.agent.firewall_drivers = iptables = neutron.agent.linux.iptables_firewall:IptablesFirewallDriver iptables_hybrid = neutron.agent.linux.iptables_firewall:OVSHybridIptablesFirewallDriver openvswitch = neutron.agent.linux.openvswitch_firewall:OVSFirewallDriver +tempest.test_plugins = + neutron_tests = neutron.tests.tempest.plugin:NeutronTempestPlugin [build_sphinx] all_files = 1 diff --git a/tox.ini b/tox.ini index 88a28c78143..9855785dd90 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ commands = basepython = python2.7 passenv = {[testenv]passenv} TEMPEST_CONFIG_DIR setenv = {[testenv]setenv} - OS_TEST_PATH=./neutron/tests/api + OS_TEST_PATH=./neutron/tests/tempest/api TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc} OS_TEST_API_WITH_REST=1