From b5ce7357f250bad1ccc99ad47d96628beaded5c9 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> Date: Fri, 12 Feb 2016 12:20:27 +0000 Subject: [PATCH] Use quotas/security_groups clients from tempest-lib The files below have been migrated to tempest-lib * quotas_client.py : I559c7ec29d6cc85060d59b8b7714a669a277f217 * security_groups_client.py: I559c7ec29d6cc85060d59b8b7714a669a277f217 Now Tempest-lib provides those as stable interfaces. So Tempest should start using those from lib and remove its own copy. Change-Id: Ib97637566b5f48523b7b39899f0350fdf8f87a9e --- tempest/clients.py | 8 ++-- tempest/hacking/ignored_list_T111.txt | 1 - .../services/network/json/quotas_client.py | 35 ----------------- .../network/json/security_groups_client.py | 38 ------------------- tempest/tests/common/test_dynamic_creds.py | 2 +- 5 files changed, 5 insertions(+), 79 deletions(-) delete mode 100644 tempest/services/network/json/quotas_client.py delete mode 100644 tempest/services/network/json/security_groups_client.py diff --git a/tempest/clients.py b/tempest/clients.py index d617b0f5c7..c9cd9d03d8 100644 --- a/tempest/clients.py +++ b/tempest/clients.py @@ -81,6 +81,10 @@ from tempest_lib.services.network.metering_labels_client import \ MeteringLabelsClient from tempest_lib.services.network.networks_client import NetworksClient from tempest_lib.services.network.ports_client import PortsClient +from tempest_lib.services.network.quotas_client import QuotasClient \ + as NetworkQuotasClient +from tempest_lib.services.network.security_groups_client import \ + SecurityGroupsClient from tempest_lib.services.network.subnets_client import SubnetsClient from tempest.common import negative_rest_client @@ -128,12 +132,8 @@ from tempest.services.image.v2.json.images_client import ImagesClientV2 from tempest.services.messaging.json.messaging_client import \ MessagingClient from tempest.services.network.json.network_client import NetworkClient -from tempest.services.network.json.quotas_client import QuotasClient \ - as NetworkQuotasClient from tempest.services.network.json.security_group_rules_client import \ SecurityGroupRulesClient -from tempest.services.network.json.security_groups_client import \ - SecurityGroupsClient from tempest.services.network.json.subnetpools_client import SubnetpoolsClient from tempest.services.object_storage.account_client import AccountClient from tempest.services.object_storage.container_client import ContainerClient diff --git a/tempest/hacking/ignored_list_T111.txt b/tempest/hacking/ignored_list_T111.txt index 20d58d28ae..8017e764ac 100644 --- a/tempest/hacking/ignored_list_T111.txt +++ b/tempest/hacking/ignored_list_T111.txt @@ -1,2 +1 @@ ./tempest/services/baremetal/base.py -./tempest/services/network/json/quotas_client.py diff --git a/tempest/services/network/json/quotas_client.py b/tempest/services/network/json/quotas_client.py deleted file mode 100644 index 9b65a544e9..0000000000 --- a/tempest/services/network/json/quotas_client.py +++ /dev/null @@ -1,35 +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.services.network.json import base - - -class QuotasClient(base.BaseNetworkClient): - - def update_quotas(self, tenant_id, **kwargs): - put_body = {'quota': kwargs} - uri = '/quotas/%s' % tenant_id - return self.update_resource(uri, put_body) - - def reset_quotas(self, tenant_id): - uri = '/quotas/%s' % tenant_id - return self.delete_resource(uri) - - def show_quotas(self, tenant_id, **fields): - uri = '/quotas/%s' % tenant_id - return self.show_resource(uri, **fields) - - def list_quotas(self, **filters): - uri = '/quotas' - return self.list_resources(uri, **filters) diff --git a/tempest/services/network/json/security_groups_client.py b/tempest/services/network/json/security_groups_client.py deleted file mode 100644 index a60d2a66f3..0000000000 --- a/tempest/services/network/json/security_groups_client.py +++ /dev/null @@ -1,38 +0,0 @@ -# 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.services.network.json import base - - -class SecurityGroupsClient(base.BaseNetworkClient): - - def create_security_group(self, **kwargs): - uri = '/security-groups' - post_data = {'security_group': kwargs} - return self.create_resource(uri, post_data) - - def update_security_group(self, security_group_id, **kwargs): - uri = '/security-groups/%s' % security_group_id - post_data = {'security_group': kwargs} - return self.update_resource(uri, post_data) - - def show_security_group(self, security_group_id, **fields): - uri = '/security-groups/%s' % security_group_id - return self.show_resource(uri, **fields) - - def delete_security_group(self, security_group_id): - uri = '/security-groups/%s' % security_group_id - return self.delete_resource(uri) - - def list_security_groups(self, **filters): - uri = '/security-groups' - return self.list_resources(uri, **filters) diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py index de2000dd9d..7a21d963bf 100644 --- a/tempest/tests/common/test_dynamic_creds.py +++ b/tempest/tests/common/test_dynamic_creds.py @@ -406,7 +406,7 @@ class TestDynamicCredentialProvider(base.TestCase): return_values = (fake_http.fake_httplib({}, status=204), {}) remove_secgroup_mock = self.patch( - 'tempest.services.network.json.security_groups_client.' + 'tempest_lib.services.network.security_groups_client.' 'SecurityGroupsClient.delete', return_value=return_values) creds.clear_creds() # Verify default security group delete