update Quantum to Neutron

Update to use the neutronclient library and replaces Quantum references within
the repository.

implements bug: 1197208

Change-Id: Ib3d52e3d9671fe4b30c4bcf76b5e7c2ee9de4664
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 0af8e9b..12aa399 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -181,9 +181,9 @@
 # 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 @@
 # 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 606d7ae..b3c706b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,7 +11,7 @@
 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 34f96ba..2eaf3b0 100644
--- a/tempest/api/compute/admin/test_fixed_ips.py
+++ b/tempest/api/compute/admin/test_fixed_ips.py
@@ -56,8 +56,8 @@
 
     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 12c646d..e105121 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 @@
                           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 113ac78..de095c5 100644
--- a/tempest/api/compute/servers/test_attach_interfaces.py
+++ b/tempest/api/compute/servers/test_attach_interfaces.py
@@ -24,8 +24,8 @@
 
     @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 9073aeb..35f0fc0 100644
--- a/tempest/api/compute/servers/test_virtual_interfaces.py
+++ b/tempest/api/compute/servers/test_virtual_interfaces.py
@@ -37,8 +37,8 @@
         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 03e73df..3b7f9dd 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 @@
     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 22eb1d3..c3fb821 100644
--- a/tempest/api/network/common.py
+++ b/tempest/api/network/common.py
@@ -32,7 +32,7 @@
 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 1f45f92..4481853 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 @@
         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 f6fd1d9..96b144c 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -280,7 +280,7 @@
 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 @@
                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 5e941da..f9eb968 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 366ff43..e3a23bb 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 @@
         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 @@
 
     @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 @@
                 raise
         else:
             cls.enabled = False
-            msg = 'Quantum not available'
+            msg = 'Neutron not available'
             raise cls.skipException(msg)
 
     @classmethod
@@ -358,7 +358,7 @@
             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 b94caaa..390e004 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -26,7 +26,7 @@
 
     """
     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 8c3af73..267aff6 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 @@
                 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 @@
                 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 @@
                 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 4758ddd..c4fe6b1 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