Merge "[V3] Renaming policy_client into policies_client"
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index f38d25d..3b5e5d4 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -21,7 +21,7 @@
 class PoliciesTestJSON(base.BaseIdentityV3AdminTest):
 
     def _delete_policy(self, policy_id):
-        self.policy_client.delete_policy(policy_id)
+        self.policies_client.delete_policy(policy_id)
 
     @test.idempotent_id('1a0ad286-2d06-4123-ab0d-728893a76201')
     def test_list_policies(self):
@@ -31,13 +31,13 @@
         for _ in range(3):
             blob = data_utils.rand_name('BlobName')
             policy_type = data_utils.rand_name('PolicyType')
-            policy = self.policy_client.create_policy(
+            policy = self.policies_client.create_policy(
                 blob=blob, type=policy_type)['policy']
             # Delete the Policy at the end of this method
             self.addCleanup(self._delete_policy, policy['id'])
             policy_ids.append(policy['id'])
         # List and Verify Policies
-        body = self.policy_client.list_policies()['policies']
+        body = self.policies_client.list_policies()['policies']
         for p in body:
             fetched_ids.append(p['id'])
         missing_pols = [p for p in policy_ids if p not in fetched_ids]
@@ -49,8 +49,8 @@
         # Test to update policy
         blob = data_utils.rand_name('BlobName')
         policy_type = data_utils.rand_name('PolicyType')
-        policy = self.policy_client.create_policy(blob=blob,
-                                                  type=policy_type)['policy']
+        policy = self.policies_client.create_policy(blob=blob,
+                                                    type=policy_type)['policy']
         self.addCleanup(self._delete_policy, policy['id'])
         self.assertIn('id', policy)
         self.assertIn('type', policy)
@@ -60,11 +60,12 @@
         self.assertEqual(policy_type, policy['type'])
         # Update policy
         update_type = data_utils.rand_name('UpdatedPolicyType')
-        data = self.policy_client.update_policy(
+        data = self.policies_client.update_policy(
             policy['id'], type=update_type)['policy']
         self.assertIn('type', data)
         # Assertion for updated value with fetched value
-        fetched_policy = self.policy_client.show_policy(policy['id'])['policy']
+        fetched_policy = self.policies_client.show_policy(
+            policy['id'])['policy']
         self.assertIn('id', fetched_policy)
         self.assertIn('blob', fetched_policy)
         self.assertIn('type', fetched_policy)
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index c6d1ac7..d60b66a 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -145,7 +145,7 @@
         cls.endpoints_client = cls.os_adm.endpoints_client
         cls.region_client = cls.os_adm.region_client
         cls.services_client = cls.os_adm.identity_services_client
-        cls.policy_client = cls.os_adm.policy_client
+        cls.policies_client = cls.os_adm.policies_client
         cls.creds_client = cls.os_adm.credentials_client
         cls.groups_client = cls.os_adm.groups_client
 
diff --git a/tempest/clients.py b/tempest/clients.py
index 8564c64..0e96e9c 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -99,8 +99,8 @@
 from tempest.services.identity.v3.json.groups_client import \
     GroupsClient as GroupsV3Client
 from tempest.services.identity.v3.json.identity_client import IdentityV3Client
-from tempest.services.identity.v3.json.policy_client import \
-    PolicyClient as PolicyV3Client
+from tempest.services.identity.v3.json.policies_client import \
+    PoliciesClient as PoliciesV3Client
 from tempest.services.identity.v3.json.region_client import \
     RegionClient as RegionV3Client
 from tempest.services.identity.v3.json.services_client import \
@@ -460,7 +460,8 @@
                                                  **params_v3)
         self.identity_services_client = IdentityServicesV3Client(
             self.auth_provider, **params_v3)
-        self.policy_client = PolicyV3Client(self.auth_provider, **params_v3)
+        self.policies_client = PoliciesV3Client(self.auth_provider,
+                                                **params_v3)
         self.region_client = RegionV3Client(self.auth_provider, **params_v3)
         self.credentials_client = CredentialsV3Client(self.auth_provider,
                                                       **params_v3)
diff --git a/tempest/services/identity/v3/json/policy_client.py b/tempest/services/identity/v3/json/policies_client.py
similarity index 97%
rename from tempest/services/identity/v3/json/policy_client.py
rename to tempest/services/identity/v3/json/policies_client.py
index 7927ed5..639ed6d 100644
--- a/tempest/services/identity/v3/json/policy_client.py
+++ b/tempest/services/identity/v3/json/policies_client.py
@@ -22,7 +22,7 @@
 from tempest.common import service_client
 
 
-class PolicyClient(service_client.ServiceClient):
+class PoliciesClient(service_client.ServiceClient):
     api_version = "v3"
 
     def create_policy(self, **kwargs):
diff --git a/tempest/tests/common/test_service_clients.py b/tempest/tests/common/test_service_clients.py
index daeb0c0..a02b23d 100644
--- a/tempest/tests/common/test_service_clients.py
+++ b/tempest/tests/common/test_service_clients.py
@@ -26,7 +26,7 @@
 from tempest.services.identity.v3.json import endpoints_client
 from tempest.services.identity.v3.json import identity_client as \
     identity_v3_identity_client
-from tempest.services.identity.v3.json import policy_client
+from tempest.services.identity.v3.json import policies_client
 from tempest.services.identity.v3.json import region_client
 from tempest.services.identity.v3.json import services_client
 from tempest.services.image.v1.json import images_client
@@ -118,7 +118,7 @@
             credentials_client.CredentialsClient,
             endpoints_client.EndPointClient,
             identity_v3_identity_client.IdentityV3Client,
-            policy_client.PolicyClient,
+            policies_client.PoliciesClient,
             region_client.RegionClient,
             services_client.ServicesClient,
             images_client.ImagesClient,