From f2982e85440491dcd0e5b3b372b914672d0813be Mon Sep 17 00:00:00 2001 From: Mark McClain Date: Sat, 6 Jul 2013 17:48:03 -0400 Subject: [PATCH] update Quantum to Neutron Update to use the neutronclient library and replaces Quantum references within the repository. implements bug: 1197208 Change-Id: Ib3d52e3d9671fe4b30c4bcf76b5e7c2ee9de4664 --- etc/tempest.conf.sample | 8 ++++---- requirements.txt | 2 +- tempest/api/compute/admin/test_fixed_ips.py | 4 ++-- .../security_groups/test_security_groups.py | 4 ++-- .../api/compute/servers/test_attach_interfaces.py | 4 ++-- .../api/compute/servers/test_virtual_interfaces.py | 4 ++-- tempest/api/network/base.py | 10 +++++----- tempest/api/network/common.py | 2 +- tempest/api/network/test_networks.py | 6 +++--- tempest/config.py | 6 +++--- tempest/hacking/checks.py | 2 +- tempest/scenario/manager.py | 14 +++++++------- tempest/scenario/test_network_basic_ops.py | 2 +- tempest/scenario/test_network_quotas.py | 8 ++++---- tempest/services/network/json/network_client.py | 4 ++-- 15 files changed, 40 insertions(+), 40 deletions(-) diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 0af8e9befc..12aa3991a0 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -181,9 +181,9 @@ http_image = http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar. # This section contains configuration options used when executing tests # against the OpenStack Network API. -# Version of the Quantum API +# Version of the Neutron API api_version = v1.1 -# Catalog type of the Quantum Service +# Catalog type of the Neutron Service catalog_type = network # A large private cidr block from which to allocate smaller blocks for @@ -206,8 +206,8 @@ public_network_id = {$PUBLIC_NETWORK_ID} # for each tenant to have their own router. public_router_id = {$PUBLIC_ROUTER_ID} -# Whether or not quantum is expected to be available -quantum_available = false +# Whether or not neutron is expected to be available +neutron_available = false [volume] # This section contains the configuration options used when executing tests diff --git a/requirements.txt b/requirements.txt index 606d7ae68d..b3c706bd26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ netaddr python-glanceclient>=0.5.0 python-keystoneclient>=0.2.0 python-novaclient>=2.10.0 -python-quantumclient>=2.1 +python-neutronclient>=2.2.3,<3.0.0 python-cinderclient>=1.0.4,<2 testresources keyring diff --git a/tempest/api/compute/admin/test_fixed_ips.py b/tempest/api/compute/admin/test_fixed_ips.py index 34f96ba416..2eaf3b0fda 100644 --- a/tempest/api/compute/admin/test_fixed_ips.py +++ b/tempest/api/compute/admin/test_fixed_ips.py @@ -56,8 +56,8 @@ class FixedIPsTestJson(FixedIPsBase): CONF = config.TempestConfig() - @testtools.skipIf(CONF.network.quantum_available, "This feature is not" + - "implemented by Quantum. See bug: #1194569") + @testtools.skipIf(CONF.network.neutron_available, "This feature is not" + + "implemented by Neutron. See bug: #1194569") @attr(type='gate') def test_list_fixed_ip_details(self): resp, fixed_ip = self.client.get_fixed_ip_details(self.ip) diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py index 12c646d1f7..e105121771 100644 --- a/tempest/api/compute/security_groups/test_security_groups.py +++ b/tempest/api/compute/security_groups/test_security_groups.py @@ -158,8 +158,8 @@ def test_security_group_create_with_invalid_group_description(self): self.client.create_security_group, s_name, s_description) - @testtools.skipIf(config.TempestConfig().network.quantum_available, - "Quantum allows duplicate names for security groups") + @testtools.skipIf(config.TempestConfig().network.neutron_available, + "Neutron allows duplicate names for security groups") @attr(type=['negative', 'gate']) def test_security_group_create_with_duplicate_name(self): # Negative test:Security Group with duplicate name should not diff --git a/tempest/api/compute/servers/test_attach_interfaces.py b/tempest/api/compute/servers/test_attach_interfaces.py index 113ac78e72..de095c58ac 100644 --- a/tempest/api/compute/servers/test_attach_interfaces.py +++ b/tempest/api/compute/servers/test_attach_interfaces.py @@ -24,8 +24,8 @@ class AttachInterfacesTestJSON(base.BaseComputeTest): @classmethod def setUpClass(cls): - if not cls.config.network.quantum_available: - raise cls.skipException("Quantum is required") + if not cls.config.network.neutron_available: + raise cls.skipException("Neutron is required") super(AttachInterfacesTestJSON, cls).setUpClass() cls.client = cls.os.interfaces_client diff --git a/tempest/api/compute/servers/test_virtual_interfaces.py b/tempest/api/compute/servers/test_virtual_interfaces.py index 9073aebb12..35f0fc0a5f 100644 --- a/tempest/api/compute/servers/test_virtual_interfaces.py +++ b/tempest/api/compute/servers/test_virtual_interfaces.py @@ -37,8 +37,8 @@ def setUpClass(cls): resp, server = cls.create_server(wait_until='ACTIVE') cls.server_id = server['id'] - @testtools.skipIf(CONF.network.quantum_available, "This feature is not " + - "implemented by Quantum. See bug: #1183436") + @testtools.skipIf(CONF.network.neutron_available, "This feature is not " + + "implemented by Neutron. See bug: #1183436") @attr(type='gate') def test_list_virtual_interfaces(self): # Positive test:Should be able to GET the virtual interfaces list diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py index 03e73dfc8e..3b7f9dd91f 100644 --- a/tempest/api/network/base.py +++ b/tempest/api/network/base.py @@ -26,11 +26,11 @@ class BaseNetworkTest(tempest.test.BaseTestCase): """ - Base class for the Quantum tests that use the Tempest Quantum REST client + Base class for the Neutron tests that use the Tempest Neutron REST client - Per the Quantum API Guide, API v1.x was removed from the source code tree + Per the Neutron API Guide, API v1.x was removed from the source code tree (docs.openstack.org/api/openstack-network/2.0/content/Overview-d1e71.html) - Therefore, v2.x of the Quantum API is assumed. It is also assumed that the + Therefore, v2.x of the Neutron API is assumed. It is also assumed that the following options are defined in the [network] section of etc/tempest.conf: tenant_network_cidr with a block of cidr's from which smaller blocks @@ -44,8 +44,8 @@ class BaseNetworkTest(tempest.test.BaseTestCase): def setUpClass(cls): os = clients.Manager() cls.network_cfg = os.config.network - if not cls.network_cfg.quantum_available: - raise cls.skipException("Quantum support is required") + if not cls.network_cfg.neutron_available: + raise cls.skipException("Neutron support is required") cls.client = os.network_client cls.networks = [] cls.subnets = [] diff --git a/tempest/api/network/common.py b/tempest/api/network/common.py index 22eb1d3e60..c3fb82127b 100644 --- a/tempest/api/network/common.py +++ b/tempest/api/network/common.py @@ -32,7 +32,7 @@ def __getattr__(self, name): class DeletableResource(AttributeDict): """ - Support deletion of quantum resources (networks, subnets) via a + Support deletion of neutron resources (networks, subnets) via a delete() method, as is supported by keystone and nova resources. """ diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py index 1f45f9272f..4481853838 100644 --- a/tempest/api/network/test_networks.py +++ b/tempest/api/network/test_networks.py @@ -26,8 +26,8 @@ class NetworksTest(base.BaseNetworkTest): """ - Tests the following operations in the Quantum API using the REST client for - Quantum: + Tests the following operations in the Neutron API using the REST client for + Neutron: create a network for a tenant list tenant's networks @@ -36,7 +36,7 @@ class NetworksTest(base.BaseNetworkTest): list tenant's subnets show a tenant subnet details - v2.0 of the Quantum API is assumed. It is also assumed that the following + v2.0 of the Neutron API is assumed. It is also assumed that the following options are defined in the [network] section of etc/tempest.conf: tenant_network_cidr with a block of cidr's from which smaller blocks diff --git a/tempest/config.py b/tempest/config.py index f6fd1d908b..96b144c313 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -280,7 +280,7 @@ def register_image_opts(conf): NetworkGroup = [ cfg.StrOpt('catalog_type', default='network', - help='Catalog type of the Quantum service.'), + help='Catalog type of the Neutron service.'), cfg.StrOpt('tenant_network_cidr', default="10.100.0.0/16", help="The cidr block to allocate tenant networks from"), @@ -299,9 +299,9 @@ def register_image_opts(conf): default="", help="Id of the public router that provides external " "connectivity"), - cfg.BoolOpt('quantum_available', + cfg.BoolOpt('neutron_available', default=False, - help="Whether or not quantum is expected to be available"), + help="Whether or not neutron is expected to be available"), ] diff --git a/tempest/hacking/checks.py b/tempest/hacking/checks.py index 5e941da1ec..f9eb968be1 100644 --- a/tempest/hacking/checks.py +++ b/tempest/hacking/checks.py @@ -17,7 +17,7 @@ import re -PYTHON_CLIENTS = ['cinder', 'glance', 'keystone', 'nova', 'swift', 'quantum'] +PYTHON_CLIENTS = ['cinder', 'glance', 'keystone', 'nova', 'swift', 'neutron'] SKIP_DECORATOR_RE = re.compile(r'\s*@testtools.skip\((.*)\)') SKIP_STR_RE = re.compile(r'.*Bug #\d+.*') diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index 366ff43759..e3a23bbb17 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -24,9 +24,9 @@ import glanceclient import keystoneclient.v2_0.client import netaddr +from neutronclient.common import exceptions as exc +import neutronclient.v2_0.client import novaclient.client -from quantumclient.common import exceptions as exc -import quantumclient.v2_0.client from tempest.api.network import common as net_common @@ -166,7 +166,7 @@ def _get_network_client(self): auth_url = self.config.identity.uri dscv = self.config.identity.disable_ssl_certificate_validation - return quantumclient.v2_0.client.Client(username=username, + return neutronclient.v2_0.client.Client(username=username, password=password, tenant_name=tenant_name, auth_url=auth_url, @@ -236,9 +236,9 @@ class NetworkScenarioTest(OfficialClientTest): @classmethod def check_preconditions(cls): - if (cls.config.network.quantum_available): + if (cls.config.network.neutron_available): cls.enabled = True - #verify that quantum_available is telling the truth + #verify that neutron_available is telling the truth try: cls.network_client.list_networks() except exc.EndpointNotFound: @@ -246,7 +246,7 @@ def check_preconditions(cls): raise else: cls.enabled = False - msg = 'Quantum not available' + msg = 'Neutron not available' raise cls.skipException(msg) @classmethod @@ -358,7 +358,7 @@ def _create_subnet(self, network, namestart='subnet-smoke-'): try: result = self.network_client.create_subnet(body=body) break - except exc.QuantumClientException as e: + except exc.NeutronClientException as e: is_overlapping_cidr = 'overlaps with another subnet' in str(e) if not is_overlapping_cidr: raise diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py index b94caaa671..390e0047cf 100644 --- a/tempest/scenario/test_network_basic_ops.py +++ b/tempest/scenario/test_network_basic_ops.py @@ -26,7 +26,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest): """ This smoke test suite assumes that Nova has been configured to - boot VM's with Quantum-managed networking, and attempts to + boot VM's with Neutron-managed networking, and attempts to verify network connectivity as follows: * For a freshly-booted VM with an IP address ("port") on a given network: diff --git a/tempest/scenario/test_network_quotas.py b/tempest/scenario/test_network_quotas.py index 8c3af73de9..267aff6aea 100644 --- a/tempest/scenario/test_network_quotas.py +++ b/tempest/scenario/test_network_quotas.py @@ -15,7 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -from quantumclient.common import exceptions as exc +from neutronclient.common import exceptions as exc from tempest.scenario.manager import NetworkScenarioTest MAX_REASONABLE_ITERATIONS = 51 # more than enough. Default for port is 50. @@ -48,7 +48,7 @@ def test_create_network_until_quota_hit(self): self.networks.append( self._create_network(self.tenant_id, namestart='network-quotatest-')) - except exc.QuantumClientException as e: + except exc.NeutronClientException as e: if (e.status_code != 409): raise hit_limit = True @@ -66,7 +66,7 @@ def test_create_subnet_until_quota_hit(self): self.subnets.append( self._create_subnet(self.networks[0], namestart='subnet-quotatest-')) - except exc.QuantumClientException as e: + except exc.NeutronClientException as e: if (e.status_code != 409): raise hit_limit = True @@ -84,7 +84,7 @@ def test_create_ports_until_quota_hit(self): self.ports.append( self._create_port(self.networks[0], namestart='port-quotatest-')) - except exc.QuantumClientException as e: + except exc.NeutronClientException as e: if (e.status_code != 409): raise hit_limit = True diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py index 4758ddd78c..c4fe6b106f 100644 --- a/tempest/services/network/json/network_client.py +++ b/tempest/services/network/json/network_client.py @@ -5,10 +5,10 @@ class NetworkClient(RestClient): """ - Tempest REST client for Quantum. Uses v2 of the Quantum API, since the + Tempest REST client for Neutron. Uses v2 of the Neutron API, since the V1 API has been removed from the code base. - Implements the following operations for each one of the basic Quantum + Implements the following operations for each one of the basic Neutron abstractions (networks, sub-networks and ports): create