Skip to content

Commit

Permalink
update Quantum to Neutron
Browse files Browse the repository at this point in the history
Update to use the neutronclient library and replaces Quantum references within
the repository.

implements bug: 1197208

Change-Id: Ib3d52e3d9671fe4b30c4bcf76b5e7c2ee9de4664
  • Loading branch information
markmcclain committed Jul 7, 2013
1 parent 2f3ba42 commit f2982e8
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions etc/tempest.conf.sample
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tempest/api/compute/admin/test_fixed_ips.py
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tempest/api/compute/security_groups/test_security_groups.py
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tempest/api/compute/servers/test_attach_interfaces.py
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tempest/api/compute/servers/test_virtual_interfaces.py
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tempest/api/network/base.py
Expand Up @@ -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
Expand All @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion tempest/api/network/common.py
Expand Up @@ -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.
"""

Expand Down
6 changes: 3 additions & 3 deletions tempest/api/network/test_networks.py
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tempest/config.py
Expand Up @@ -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"),
Expand All @@ -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"),
]


Expand Down
2 changes: 1 addition & 1 deletion tempest/hacking/checks.py
Expand Up @@ -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+.*')
Expand Down
14 changes: 7 additions & 7 deletions tempest/scenario/manager.py
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -236,17 +236,17 @@ 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:
cls.enabled = False
raise
else:
cls.enabled = False
msg = 'Quantum not available'
msg = 'Neutron not available'
raise cls.skipException(msg)

@classmethod
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tempest/scenario/test_network_basic_ops.py
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tempest/scenario/test_network_quotas.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tempest/services/network/json/network_client.py
Expand Up @@ -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
Expand Down

0 comments on commit f2982e8

Please sign in to comment.