Fix T110 violations for servers_client
servers_client contained T110 violations, and we need to fix them
before migrating the client to tempest-lib for consistent interfaces.
Change-Id: I10a8c32b53f15063dab087d67123598800b141a0
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
index 993d39e..b038c6b 100644
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -147,7 +147,7 @@
@test.idempotent_id('31ff3486-b8a0-4f56-a6c0-aab460531db3')
def test_get_server_diagnostics_by_admin(self):
# Retrieve server diagnostics by admin user
- diagnostic = self.client.get_server_diagnostics(self.s1_id)
+ diagnostic = self.client.show_server_diagnostics(self.s1_id)
basic_attrs = ['rx_packets', 'rx_errors', 'rx_drop',
'tx_packets', 'tx_errors', 'tx_drop',
'read_req', 'write_req', 'cpu', 'memory']
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index 3d0ce35..7c5e8d0 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -130,7 +130,7 @@
def test_get_server_diagnostics_by_non_admin(self):
# Non-admin user can not view server diagnostics according to policy
self.assertRaises(lib_exc.Forbidden,
- self.non_adm_client.get_server_diagnostics,
+ self.non_adm_client.show_server_diagnostics,
self.s1_id)
@test.attr(type=['negative'])
diff --git a/tempest/api/compute/servers/test_instance_actions.py b/tempest/api/compute/servers/test_instance_actions.py
index 97d47fd..814aec7 100644
--- a/tempest/api/compute/servers/test_instance_actions.py
+++ b/tempest/api/compute/servers/test_instance_actions.py
@@ -47,7 +47,7 @@
@test.idempotent_id('aacc71ca-1d70-4aa5-bbf6-0ff71470e43c')
def test_get_instance_action(self):
# Get the action details of the provided server
- body = self.client.get_instance_action(
+ body = self.client.show_instance_action(
self.server_id, self.request_id)['instanceAction']
self.assertEqual(self.server_id, body['instance_uuid'])
self.assertEqual('create', body['action'])
diff --git a/tempest/api/compute/servers/test_instance_actions_negative.py b/tempest/api/compute/servers/test_instance_actions_negative.py
index 6567da1..ac66d05 100644
--- a/tempest/api/compute/servers/test_instance_actions_negative.py
+++ b/tempest/api/compute/servers/test_instance_actions_negative.py
@@ -46,5 +46,5 @@
@test.idempotent_id('0269f40a-6f18-456c-b336-c03623c897f1')
def test_get_instance_action_invalid_request(self):
# Get the action details of the provided server with invalid request
- self.assertRaises(lib_exc.NotFound, self.client.get_instance_action,
+ self.assertRaises(lib_exc.NotFound, self.client.show_instance_action,
self.server_id, '999')
diff --git a/tempest/api/compute/servers/test_server_metadata.py b/tempest/api/compute/servers/test_server_metadata.py
index 77ddb3b..9c07677 100644
--- a/tempest/api/compute/servers/test_server_metadata.py
+++ b/tempest/api/compute/servers/test_server_metadata.py
@@ -87,8 +87,8 @@
@test.idempotent_id('3043c57d-7e0e-49a6-9a96-ad569c265e6a')
def test_get_server_metadata_item(self):
# The value for a specific metadata key should be returned
- meta = self.client.get_server_metadata_item(self.server_id,
- 'key2')['meta']
+ meta = self.client.show_server_metadata_item(self.server_id,
+ 'key2')['meta']
self.assertEqual('value2', meta['key2'])
@test.idempotent_id('58c02d4f-5c67-40be-8744-d3fa5982eb1c')
diff --git a/tempest/api/compute/servers/test_server_metadata_negative.py b/tempest/api/compute/servers/test_server_metadata_negative.py
index cee60fb..18d80be 100644
--- a/tempest/api/compute/servers/test_server_metadata_negative.py
+++ b/tempest/api/compute/servers/test_server_metadata_negative.py
@@ -67,7 +67,7 @@
# GET on a non-existent server should not succeed
non_existent_server_id = data_utils.rand_uuid()
self.assertRaises(lib_exc.NotFound,
- self.client.get_server_metadata_item,
+ self.client.show_server_metadata_item,
non_existent_server_id,
'test2')
diff --git a/tempest/api/compute/servers/test_server_password.py b/tempest/api/compute/servers/test_server_password.py
index 35c2cfd..9b41708 100644
--- a/tempest/api/compute/servers/test_server_password.py
+++ b/tempest/api/compute/servers/test_server_password.py
@@ -32,7 +32,7 @@
@test.idempotent_id('f83b582f-62a8-4f22-85b0-0dee50ff783a')
def test_get_server_password(self):
- self.client.get_password(self.server['id'])
+ self.client.show_password(self.server['id'])
@test.idempotent_id('f8229e8b-b625-4493-800a-bde86ac611ea')
def test_delete_server_password(self):
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index f8d0cca..436ed2f 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -400,7 +400,7 @@
self.addCleanup(self.client.delete_server_metadata_item,
self.server['id'], 'meta1')
self.assertRaises(lib_exc.NotFound,
- self.alt_client.get_server_metadata_item,
+ self.alt_client.show_server_metadata_item,
self.server['id'], 'meta1')
@test.idempotent_id('16b2d724-0d3b-4216-a9fa-97bd4d9cf670')
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index ab4ddf7..b4837f7 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -144,7 +144,7 @@
self.assertIn(self.attachment, body)
# Get Volume attachment of the server
- body = self.servers_client.get_volume_attachment(
+ body = self.servers_client.show_volume_attachment(
self.server['id'],
self.attachment['id'])['volumeAttachment']
self.assertEqual(self.server['id'], body['serverId'])
diff --git a/tempest/api_schema/response/compute/v2_1/servers.py b/tempest/api_schema/response/compute/v2_1/servers.py
index 9593f3c..38f7c82 100644
--- a/tempest/api_schema/response/compute/v2_1/servers.py
+++ b/tempest/api_schema/response/compute/v2_1/servers.py
@@ -291,8 +291,8 @@
'status_code': [202]
}
-get_volume_attachment = copy.deepcopy(attach_volume)
-get_volume_attachment['response_body']['properties'][
+show_volume_attachment = copy.deepcopy(attach_volume)
+show_volume_attachment['response_body']['properties'][
'volumeAttachment']['properties'].update({'serverId': {'type': 'string'}})
list_volume_attachments = {
@@ -436,7 +436,7 @@
# 'events' does not come in response body always so it is not
# defined as 'required'
-get_instance_action = {
+show_instance_action = {
'status_code': [200],
'response_body': {
'type': 'object',
@@ -448,7 +448,7 @@
}
}
-get_password = {
+show_password = {
'status_code': [200],
'response_body': {
'type': 'object',
@@ -520,7 +520,7 @@
'status_code': [204]
}
-set_get_server_metadata_item = {
+set_show_server_metadata_item = {
'status_code': [200],
'response_body': {
'type': 'object',
diff --git a/tempest/hacking/ignored_list_T110.txt b/tempest/hacking/ignored_list_T110.txt
index 7c3e830..4e68e54 100644
--- a/tempest/hacking/ignored_list_T110.txt
+++ b/tempest/hacking/ignored_list_T110.txt
@@ -1,4 +1,3 @@
-./tempest/services/compute/json/servers_client.py
./tempest/services/database/json/flavors_client.py
./tempest/services/identity/v3/json/credentials_client.py
./tempest/services/identity/v3/json/identity_client.py
diff --git a/tempest/services/compute/json/servers_client.py b/tempest/services/compute/json/servers_client.py
index 90b7a2d..49c6da9 100644
--- a/tempest/services/compute/json/servers_client.py
+++ b/tempest/services/compute/json/servers_client.py
@@ -152,11 +152,11 @@
return self.action(server_id, 'changePassword',
adminPass=adminPass)
- def get_password(self, server_id):
+ def show_password(self, server_id):
resp, body = self.get("servers/%s/os-server-password" %
server_id)
body = json.loads(body)
- self.validate_response(schema.get_password, resp, body)
+ self.validate_response(schema.show_password, resp, body)
return service_client.ResponseBody(resp, body)
def delete_password(self, server_id):
@@ -240,10 +240,10 @@
resp, body)
return service_client.ResponseBody(resp, body)
- def get_server_metadata_item(self, server_id, key):
+ def show_server_metadata_item(self, server_id, key):
resp, body = self.get("servers/%s/metadata/%s" % (server_id, key))
body = json.loads(body)
- self.validate_response(schema.set_get_server_metadata_item,
+ self.validate_response(schema.set_show_server_metadata_item,
resp, body)
return service_client.ResponseBody(resp, body)
@@ -252,7 +252,7 @@
resp, body = self.put('servers/%s/metadata/%s' % (server_id, key),
post_body)
body = json.loads(body)
- self.validate_response(schema.set_get_server_metadata_item,
+ self.validate_response(schema.set_show_server_metadata_item,
resp, body)
return service_client.ResponseBody(resp, body)
@@ -285,12 +285,12 @@
self.validate_response(schema.detach_volume, resp, body)
return service_client.ResponseBody(resp, body)
- def get_volume_attachment(self, server_id, attach_id):
+ def show_volume_attachment(self, server_id, attach_id):
"""Return details about the given volume attachment."""
resp, body = self.get('servers/%s/os-volume_attachments/%s' % (
server_id, attach_id))
body = json.loads(body)
- self.validate_response(schema.get_volume_attachment, resp, body)
+ self.validate_response(schema.show_volume_attachment, resp, body)
return service_client.ResponseBody(resp, body)
def list_volume_attachments(self, server_id):
@@ -387,7 +387,7 @@
"""Unrescue the provided server."""
return self.action(server_id, 'unrescue')
- def get_server_diagnostics(self, server_id):
+ def show_server_diagnostics(self, server_id):
"""Get the usage data for a server."""
resp, body = self.get("servers/%s/diagnostics" % server_id)
return service_client.ResponseBody(resp, json.loads(body))
@@ -400,12 +400,12 @@
self.validate_response(schema.list_instance_actions, resp, body)
return service_client.ResponseBody(resp, body)
- def get_instance_action(self, server_id, request_id):
+ def show_instance_action(self, server_id, request_id):
"""Returns the action details of the provided server."""
resp, body = self.get("servers/%s/os-instance-actions/%s" %
(server_id, request_id))
body = json.loads(body)
- self.validate_response(schema.get_instance_action, resp, body)
+ self.validate_response(schema.show_instance_action, resp, body)
return service_client.ResponseBody(resp, body)
def force_delete_server(self, server_id, **kwargs):