Merge "Rename instance_actions v3 plugin tests to server_actions"
This commit is contained in:
commit
dc5c270d10
@ -27,25 +27,27 @@ class InstanceActionsV3Test(base.BaseV3ComputeTest):
|
||||
cls.resp = resp
|
||||
cls.server_id = server['id']
|
||||
|
||||
@test.skip_because(bug="1206032")
|
||||
@test.attr(type='gate')
|
||||
def test_list_instance_actions(self):
|
||||
def test_list_server_actions(self):
|
||||
# List actions of the provided server
|
||||
resp, body = self.client.reboot(self.server_id, 'HARD')
|
||||
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
|
||||
|
||||
resp, body = self.client.list_instance_actions(self.server_id)
|
||||
resp, body = self.client.list_server_actions(self.server_id)
|
||||
self.assertEqual(200, resp.status)
|
||||
self.assertTrue(len(body) == 2, str(body))
|
||||
self.assertTrue(any([i for i in body if i['action'] == 'create']))
|
||||
self.assertTrue(any([i for i in body if i['action'] == 'reboot']))
|
||||
|
||||
@test.skip_because(bug="1206032")
|
||||
@test.attr(type='gate')
|
||||
@test.skip_because(bug="1281915")
|
||||
def test_get_instance_action(self):
|
||||
def test_get_server_action(self):
|
||||
# Get the action details of the provided server
|
||||
request_id = self.resp['x-compute-request-id']
|
||||
resp, body = self.client.get_instance_action(self.server_id,
|
||||
resp, body = self.client.get_server_action(self.server_id,
|
||||
request_id)
|
||||
self.assertEqual(200, resp.status)
|
||||
self.assertEqual(self.server_id, body['instance_uuid'])
|
||||
self.assertEqual(self.server_id, body['server_uuid'])
|
||||
self.assertEqual('create', body['action'])
|
||||
|
@ -29,15 +29,15 @@ class InstanceActionsNegativeV3Test(base.BaseV3ComputeTest):
|
||||
cls.server_id = server['id']
|
||||
|
||||
@test.attr(type=['negative', 'gate'])
|
||||
def test_list_instance_actions_invalid_server(self):
|
||||
def test_list_server_actions_invalid_server(self):
|
||||
# List actions of the invalid server id
|
||||
invalid_server_id = data_utils.rand_uuid()
|
||||
self.assertRaises(exceptions.NotFound,
|
||||
self.client.list_instance_actions, invalid_server_id)
|
||||
self.client.list_server_actions, invalid_server_id)
|
||||
|
||||
@test.attr(type=['negative', 'gate'])
|
||||
def test_get_instance_action_invalid_request(self):
|
||||
def test_get_server_action_invalid_request(self):
|
||||
# Get the action details of the provided server with invalid request
|
||||
invalid_request_id = 'req-' + data_utils.rand_uuid()
|
||||
self.assertRaises(exceptions.NotFound, self.client.get_instance_action,
|
||||
self.assertRaises(exceptions.NotFound, self.client.get_server_action,
|
||||
self.server_id, invalid_request_id)
|
||||
|
@ -410,19 +410,19 @@ class ServersV3ClientJSON(rest_client.RestClient):
|
||||
str(server_id))
|
||||
return resp, json.loads(body)
|
||||
|
||||
def list_instance_actions(self, server_id):
|
||||
def list_server_actions(self, server_id):
|
||||
"""List the provided server action."""
|
||||
resp, body = self.get("servers/%s/os-instance-actions" %
|
||||
resp, body = self.get("servers/%s/os-server-actions" %
|
||||
str(server_id))
|
||||
body = json.loads(body)
|
||||
return resp, body['instance_actions']
|
||||
return resp, body['server_actions']
|
||||
|
||||
def get_instance_action(self, server_id, request_id):
|
||||
def get_server_action(self, server_id, request_id):
|
||||
"""Returns the action details of the provided server."""
|
||||
resp, body = self.get("servers/%s/os-instance-actions/%s" %
|
||||
resp, body = self.get("servers/%s/os-server-actions/%s" %
|
||||
(str(server_id), str(request_id)))
|
||||
body = json.loads(body)
|
||||
return resp, body['instance_action']
|
||||
return resp, body['server_action']
|
||||
|
||||
def force_delete_server(self, server_id, **kwargs):
|
||||
"""Force delete a server."""
|
||||
|
Loading…
Reference in New Issue
Block a user