Merge "Use Tempest-lib's compute extensions_client"
diff --git a/tempest/api_schema/response/compute/v2_1/extensions.py b/tempest/api_schema/response/compute/v2_1/extensions.py
deleted file mode 100644
index a6a455c..0000000
--- a/tempest/api_schema/response/compute/v2_1/extensions.py
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2014 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.
-
-list_extensions = {
- 'status_code': [200],
- 'response_body': {
- 'type': 'object',
- 'properties': {
- 'extensions': {
- 'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- 'updated': {
- 'type': 'string',
- 'format': 'data-time'
- },
- 'name': {'type': 'string'},
- 'links': {'type': 'array'},
- 'namespace': {
- 'type': 'string',
- 'format': 'uri'
- },
- 'alias': {'type': 'string'},
- 'description': {'type': 'string'}
- },
- 'additionalProperties': False,
- 'required': ['updated', 'name', 'links', 'namespace',
- 'alias', 'description']
- }
- }
- },
- 'additionalProperties': False,
- 'required': ['extensions']
- }
-}
diff --git a/tempest/clients.py b/tempest/clients.py
index 4e69424..b593089 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -24,6 +24,8 @@
BaremetalNodesClient
from tempest_lib.services.compute.certificates_client import \
CertificatesClient
+from tempest_lib.services.compute.extensions_client import \
+ ExtensionsClient
from tempest_lib.services.identity.v2.token_client import TokenClient
from tempest_lib.services.identity.v3.token_client import V3TokenClient
@@ -35,8 +37,6 @@
from tempest.services.baremetal.v1.json.baremetal_client import \
BaremetalClient
from tempest.services import botoclients
-from tempest.services.compute.json.extensions_client import \
- ExtensionsClient
from tempest.services.compute.json.fixed_ips_client import FixedIPsClient
from tempest.services.compute.json.flavors_client import FlavorsClient
from tempest.services.compute.json.floating_ip_pools_client import \
diff --git a/tempest/services/compute/json/extensions_client.py b/tempest/services/compute/json/extensions_client.py
deleted file mode 100644
index 4741812..0000000
--- a/tempest/services/compute/json/extensions_client.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-# 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 oslo_serialization import jsonutils as json
-
-from tempest.api_schema.response.compute.v2_1 import extensions as schema
-from tempest.common import service_client
-
-
-class ExtensionsClient(service_client.ServiceClient):
-
- def list_extensions(self):
- url = 'extensions'
- resp, body = self.get(url)
- body = json.loads(body)
- self.validate_response(schema.list_extensions, resp, body)
- return service_client.ResponseBody(resp, body)
-
- def show_extension(self, extension_alias):
- resp, body = self.get('extensions/%s' % extension_alias)
- body = json.loads(body)
- return service_client.ResponseBody(resp, body)
diff --git a/tempest/tests/common/test_service_clients.py b/tempest/tests/common/test_service_clients.py
index 3a6d2d3..d7f99d5 100644
--- a/tempest/tests/common/test_service_clients.py
+++ b/tempest/tests/common/test_service_clients.py
@@ -17,7 +17,6 @@
import six
from tempest.services.baremetal.v1.json import baremetal_client
-from tempest.services.compute.json import extensions_client
from tempest.services.compute.json import fixed_ips_client
from tempest.services.compute.json import flavors_client
from tempest.services.compute.json import floating_ip_pools_client
@@ -105,7 +104,6 @@
def test_service_client_creations_with_specified_args(self, mock_init):
test_clients = [
baremetal_client.BaremetalClient,
- extensions_client.ExtensionsClient,
fixed_ips_client.FixedIPsClient,
flavors_client.FlavorsClient,
floating_ip_pools_client.FloatingIPPoolsClient,
diff --git a/tempest/tests/services/compute/test_extensions_client.py b/tempest/tests/services/compute/test_extensions_client.py
deleted file mode 100644
index 21efc52..0000000
--- a/tempest/tests/services/compute/test_extensions_client.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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_lib.tests import fake_auth_provider
-
-from tempest.services.compute.json import extensions_client
-from tempest.tests.services.compute import base
-
-
-class TestExtensionsClient(base.BaseComputeServiceTest):
-
- FAKE_SHOW_EXTENSION = {
- "extension": {
- "updated": "2011-06-09T00:00:00Z",
- "name": "Multinic",
- "links": [],
- "namespace":
- "http://docs.openstack.org/compute/ext/multinic/api/v1.1",
- "alias": "NMN",
- "description": u'\u2740(*\xb4\u25e1`*)\u2740'
- }
- }
-
- def setUp(self):
- super(TestExtensionsClient, self).setUp()
- fake_auth = fake_auth_provider.FakeAuthProvider()
- self.client = extensions_client.ExtensionsClient(
- fake_auth, 'compute', 'regionOne')
-
- def _test_list_extensions(self, bytes_body=False):
- self.check_service_client_function(
- self.client.list_extensions,
- 'tempest.common.service_client.ServiceClient.get',
- {"extensions": []},
- bytes_body)
-
- def test_list_extensions_with_str_body(self):
- self._test_list_extensions()
-
- def test_list_extensions_with_bytes_body(self):
- self._test_list_extensions(bytes_body=True)
-
- def _test_show_extension(self, bytes_body=False):
- self.check_service_client_function(
- self.client.show_extension,
- 'tempest.common.service_client.ServiceClient.get',
- self.FAKE_SHOW_EXTENSION,
- bytes_body,
- extension_alias="NMN")
-
- def test_show_extension_with_str_body(self):
- self._test_show_extension()
-
- def test_show_extension_with_bytes_body(self):
- self._test_show_extension(bytes_body=True)