Merge "Separate token client from identity client"
diff --git a/requirements.txt b/requirements.txt
index 1ce2fc5..94c6fb0 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,7 +6,7 @@
httplib2>=0.7.5
jsonschema>=2.0.0,<3.0.0
testtools>=0.9.36,!=1.2.0
-boto>=2.32.1,<2.35.0
+boto>=2.32.1
paramiko>=1.13.0
netaddr>=0.7.12
python-ceilometerclient>=1.0.6
diff --git a/tempest/api/compute/test_tenant_networks.py b/tempest/api/compute/test_tenant_networks.py
new file mode 100644
index 0000000..0591acc
--- /dev/null
+++ b/tempest/api/compute/test_tenant_networks.py
@@ -0,0 +1,33 @@
+# Copyright 2015 NEC Corporation. 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.
+
+from tempest.api.compute import base
+from tempest import test
+
+
+class NetworksTestJSON(base.BaseV2ComputeTest):
+
+ @classmethod
+ def resource_setup(cls):
+ super(NetworksTestJSON, cls).resource_setup()
+ cls.client = cls.os.tenant_networks_client
+
+ @test.attr(type='gate')
+ def test_list_show_tenant_networks(self):
+ tenant_networks = self.client.list_tenant_networks()
+ self.assertNotEmpty(tenant_networks, "No tenant networks found.")
+
+ for net in tenant_networks:
+ tenant_network = self.client.get_tenant_network(net['id'])
+ self.assertEqual(net['id'], tenant_network['id'])
diff --git a/tempest/api_schema/response/compute/v2/tenant_networks.py b/tempest/api_schema/response/compute/v2/tenant_networks.py
new file mode 100644
index 0000000..0b2868a
--- /dev/null
+++ b/tempest/api_schema/response/compute/v2/tenant_networks.py
@@ -0,0 +1,50 @@
+# Copyright 2015 NEC Corporation. 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.
+
+param_network = {
+ 'type': 'object',
+ 'properties': {
+ 'id': {'type': 'string'},
+ 'cidr': {'type': ['string', 'null']},
+ 'label': {'type': 'string'}
+ },
+ 'required': ['id', 'cidr', 'label']
+}
+
+
+list_tenant_networks = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'networks': {
+ 'type': 'array',
+ 'items': param_network
+ }
+ },
+ 'required': ['networks']
+ }
+}
+
+
+get_tenant_network = {
+ 'status_code': [200],
+ 'response_body': {
+ 'type': 'object',
+ 'properties': {
+ 'network': param_network
+ },
+ 'required': ['network']
+ }
+}
diff --git a/tempest/cli/simple_read_only/compute/test_nova.py b/tempest/cli/simple_read_only/compute/test_nova.py
index 4fe4982..5efeb75 100644
--- a/tempest/cli/simple_read_only/compute/test_nova.py
+++ b/tempest/cli/simple_read_only/compute/test_nova.py
@@ -149,7 +149,7 @@
def test_admin_secgroup_list_rules(self):
self.nova('secgroup-list-rules')
- @tempest.cli.min_client_version(client='nova', version='2.18')
+ @cli.min_client_version(client='nova', version='2.18')
def test_admin_server_group_list(self):
self.nova('server-group-list')
diff --git a/tempest/clients.py b/tempest/clients.py
index 0c03ec8..03928ba 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -58,6 +58,8 @@
SecurityGroupsClientJSON
from tempest.services.compute.json.servers_client import ServersClientJSON
from tempest.services.compute.json.services_client import ServicesClientJSON
+from tempest.services.compute.json.tenant_networks_client import \
+ TenantNetworksClientJSON
from tempest.services.compute.json.tenant_usages_client import \
TenantUsagesClientJSON
from tempest.services.compute.json.volumes_extensions_client import \
@@ -263,6 +265,8 @@
**params)
self.instance_usages_audit_log_client = \
InstanceUsagesAuditLogClientJSON(self.auth_provider, **params)
+ self.tenant_networks_client = \
+ TenantNetworksClientJSON(self.auth_provider, **params)
# NOTE: The following client needs special timeout values because
# the API is a proxy for the other component.
diff --git a/tempest/common/service_client.py b/tempest/common/service_client.py
index c0a7133..dc634a1 100644
--- a/tempest/common/service_client.py
+++ b/tempest/common/service_client.py
@@ -69,18 +69,10 @@
raise exceptions.Conflict(ex)
except lib_exceptions.OverLimit as ex:
raise exceptions.OverLimit(ex)
- except lib_exceptions.RateLimitExceeded as ex:
- raise exceptions.RateLimitExceeded(ex)
except lib_exceptions.InvalidContentType as ex:
raise exceptions.InvalidContentType(ex)
except lib_exceptions.UnprocessableEntity as ex:
raise exceptions.UnprocessableEntity(ex)
- except lib_exceptions.InvalidHTTPResponseBody as ex:
- raise exceptions.InvalidHTTPResponseBody(ex)
- except lib_exceptions.NotImplemented as ex:
- raise exceptions.NotImplemented(ex)
- except lib_exceptions.ServerFault as ex:
- raise exceptions.ServerFault(ex)
# TODO(oomichi): This is just a workaround for failing gate tests
# when separating Forbidden from Unauthorized in tempest-lib.
# We will need to remove this translation and replace negative tests
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index f265186..680b92a 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -167,22 +167,10 @@
message = "Unprocessable entity"
-class RateLimitExceeded(RestClientException):
- message = "Rate limit exceeded"
-
-
class OverLimit(RestClientException):
message = "Quota exceeded"
-class ServerFault(RestClientException):
- message = "Got server fault"
-
-
-class NotImplemented(RestClientException):
- message = "Got NotImplemented error"
-
-
class Conflict(RestClientException):
message = "An object with that identifier already exists"
@@ -197,10 +185,6 @@
"MUST NOT have an entity")
-class InvalidHTTPResponseBody(RestClientException):
- message = "HTTP response body is invalid json or xml"
-
-
class InvalidHTTPResponseHeader(RestClientException):
message = "HTTP response header is invalid"
diff --git a/tempest/services/compute/json/tenant_networks_client.py b/tempest/services/compute/json/tenant_networks_client.py
new file mode 100644
index 0000000..c86c817
--- /dev/null
+++ b/tempest/services/compute/json/tenant_networks_client.py
@@ -0,0 +1,33 @@
+# Copyright 2015 NEC Corporation. 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 json
+
+from tempest.api_schema.response.compute.v2 import tenant_networks as schema
+from tempest.common import service_client
+
+
+class TenantNetworksClientJSON(service_client.ServiceClient):
+
+ def list_tenant_networks(self):
+ resp, body = self.get("os-tenant-networks")
+ body = json.loads(body)
+ self.validate_response(schema.list_tenant_networks, resp, body)
+ return service_client.ResponseBodyList(resp, body['networks'])
+
+ def get_tenant_network(self, network_id):
+ resp, body = self.get("os-tenant-networks/%s" % str(network_id))
+ body = json.loads(body)
+ self.validate_response(schema.get_tenant_network, resp, body)
+ return service_client.ResponseBody(resp, body['network'])
diff --git a/tempest/stress/actions/volume_create_delete.py b/tempest/stress/actions/volume_create_delete.py
index b1c5bb7..93402d9 100644
--- a/tempest/stress/actions/volume_create_delete.py
+++ b/tempest/stress/actions/volume_create_delete.py
@@ -20,8 +20,8 @@
name = data_utils.rand_name("volume")
self.logger.info("creating %s" % name)
volumes_client = self.manager.volumes_client
- _, volume = volumes_client.create_volume(size=1,
- display_name=name)
+ volume = volumes_client.create_volume(size=1,
+ display_name=name)
vol_id = volume['id']
volumes_client.wait_for_volume_status(vol_id, 'available')
self.logger.info("created %s" % volume['id'])