Merge "Apply a naming rule of GET to compute clients(f*)"
This commit is contained in:
commit
aa34225ab8
|
@ -50,7 +50,7 @@ class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
|
|||
@test.idempotent_id('16b7d848-2f7c-4709-85a3-2dfb4576cc52')
|
||||
@test.services('network')
|
||||
def test_list_fixed_ip_details(self):
|
||||
fixed_ip = self.client.get_fixed_ip_details(self.ip)
|
||||
fixed_ip = self.client.show_fixed_ip(self.ip)
|
||||
self.assertEqual(fixed_ip['address'], self.ip)
|
||||
|
||||
@test.idempotent_id('5485077b-7e46-4cec-b402-91dc3173433b')
|
||||
|
|
|
@ -54,7 +54,7 @@ class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
|
|||
@test.services('network')
|
||||
def test_list_fixed_ip_details_with_non_admin_user(self):
|
||||
self.assertRaises(lib_exc.Forbidden,
|
||||
self.non_admin_client.get_fixed_ip_details, self.ip)
|
||||
self.non_admin_client.show_fixed_ip, self.ip)
|
||||
|
||||
@test.attr(type=['negative'])
|
||||
@test.idempotent_id('ce60042c-fa60-4836-8d43-1c8e3359dc47')
|
||||
|
|
|
@ -82,7 +82,7 @@ class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
|
|||
self.assertEqual(flavor['os-flavor-access:is_public'], True)
|
||||
|
||||
# Verify flavor is retrieved
|
||||
flavor = self.client.get_flavor_details(flavor['id'])
|
||||
flavor = self.client.show_flavor(flavor['id'])
|
||||
self.assertEqual(flavor['name'], flavor_name)
|
||||
|
||||
return flavor['id']
|
||||
|
@ -160,7 +160,7 @@ class FlavorsAdminTestJSON(base.BaseV2ComputeAdminTest):
|
|||
verify_flavor_response_extension(flavor)
|
||||
|
||||
# Verify flavor is retrieved
|
||||
flavor = self.client.get_flavor_details(new_flavor_id)
|
||||
flavor = self.client.show_flavor(new_flavor_id)
|
||||
self.assertEqual(flavor['name'], flavor_name)
|
||||
verify_flavor_response_extension(flavor)
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
|
|||
self.client.set_flavor_extra_spec(self.flavor['id'], specs)
|
||||
self.assertEqual(set_body, specs)
|
||||
# GET extra specs and verify
|
||||
get_body = self.client.get_flavor_extra_spec(self.flavor['id'])
|
||||
get_body = self.client.list_flavor_extra_specs(self.flavor['id'])
|
||||
self.assertEqual(get_body, specs)
|
||||
|
||||
# UPDATE the value of the extra specs key1
|
||||
|
@ -87,7 +87,7 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
|
|||
|
||||
# GET extra specs and verify the value of the key2
|
||||
# is the same as before
|
||||
get_body = self.client.get_flavor_extra_spec(self.flavor['id'])
|
||||
get_body = self.client.list_flavor_extra_specs(self.flavor['id'])
|
||||
self.assertEqual(get_body, {"key1": "value", "key2": "value2"})
|
||||
|
||||
# UNSET extra specs that were set in this test
|
||||
|
@ -98,7 +98,7 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
|
|||
def test_flavor_non_admin_get_all_keys(self):
|
||||
specs = {"key1": "value1", "key2": "value2"}
|
||||
self.client.set_flavor_extra_spec(self.flavor['id'], specs)
|
||||
body = self.flavors_client.get_flavor_extra_spec(self.flavor['id'])
|
||||
body = self.flavors_client.list_flavor_extra_specs(self.flavor['id'])
|
||||
|
||||
for key in specs:
|
||||
self.assertEqual(body[key], specs[key])
|
||||
|
@ -109,7 +109,7 @@ class FlavorsExtraSpecsTestJSON(base.BaseV2ComputeAdminTest):
|
|||
body = self.client.set_flavor_extra_spec(self.flavor['id'], specs)
|
||||
self.assertEqual(body['key1'], 'value1')
|
||||
self.assertIn('key2', body)
|
||||
body = self.flavors_client.get_flavor_extra_spec_with_key(
|
||||
body = self.flavors_client.show_flavor_extra_spec(
|
||||
self.flavor['id'], 'key1')
|
||||
self.assertEqual(body['key1'], 'value1')
|
||||
self.assertNotIn('key2', body)
|
||||
|
|
|
@ -115,7 +115,7 @@ class FlavorsExtraSpecsNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||
@test.idempotent_id('329a7be3-54b2-48be-8052-bf2ce4afd898')
|
||||
def test_flavor_get_nonexistent_key(self):
|
||||
self.assertRaises(lib_exc.NotFound,
|
||||
self.flavors_client.get_flavor_extra_spec_with_key,
|
||||
self.flavors_client.show_flavor_extra_spec,
|
||||
self.flavor['id'],
|
||||
"nonexistent_key")
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class ServersAdminNegativeTestJSON(base.BaseV2ComputeAdminTest):
|
|||
flavor_id = data_utils.rand_int_id(start=1000)
|
||||
while True:
|
||||
try:
|
||||
self.flavors_client.get_flavor_details(flavor_id)
|
||||
self.flavors_client.show_flavor(flavor_id)
|
||||
except lib_exc.NotFound:
|
||||
break
|
||||
flavor_id = data_utils.rand_int_id(start=1000)
|
||||
|
|
|
@ -33,7 +33,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
def test_list_flavors(self):
|
||||
# List of all flavors should contain the expected flavor
|
||||
flavors = self.client.list_flavors()
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_min_detail = {'id': flavor['id'], 'links': flavor['links'],
|
||||
'name': flavor['name']}
|
||||
self.assertIn(flavor_min_detail, flavors)
|
||||
|
@ -42,14 +42,14 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
def test_list_flavors_with_detail(self):
|
||||
# Detailed list of all flavors should contain the expected flavor
|
||||
flavors = self.client.list_flavors_with_detail()
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
self.assertIn(flavor, flavors)
|
||||
|
||||
@test.attr(type='smoke')
|
||||
@test.idempotent_id('1f12046b-753d-40d2-abb6-d8eb8b30cb2f')
|
||||
def test_get_flavor(self):
|
||||
# The expected flavor details should be returned
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
self.assertEqual(self.flavor_ref, flavor['id'])
|
||||
|
||||
@test.idempotent_id('8d7691b3-6ed4-411a-abc9-2839a765adab')
|
||||
|
@ -69,7 +69,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('e800f879-9828-4bd0-8eae-4f17189951fb')
|
||||
def test_list_flavors_using_marker(self):
|
||||
# The list of flavors should start from the provided marker
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {'marker': flavor_id}
|
||||
|
@ -80,7 +80,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('6db2f0c0-ddee-4162-9c84-0703d3dd1107')
|
||||
def test_list_flavors_detailed_using_marker(self):
|
||||
# The list of flavors should start from the provided marker
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {'marker': flavor_id}
|
||||
|
@ -91,7 +91,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('3df2743e-3034-4e57-a4cb-b6527f6eac79')
|
||||
def test_list_flavors_detailed_filter_by_min_disk(self):
|
||||
# The detailed list of flavors should be filtered by disk space
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {self._min_disk: flavor['disk'] + 1}
|
||||
|
@ -101,7 +101,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('09fe7509-b4ee-4b34-bf8b-39532dc47292')
|
||||
def test_list_flavors_detailed_filter_by_min_ram(self):
|
||||
# The detailed list of flavors should be filtered by RAM
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {self._min_ram: flavor['ram'] + 1}
|
||||
|
@ -111,7 +111,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('10645a4d-96f5-443f-831b-730711e11dd4')
|
||||
def test_list_flavors_filter_by_min_disk(self):
|
||||
# The list of flavors should be filtered by disk space
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {self._min_disk: flavor['disk'] + 1}
|
||||
|
@ -121,7 +121,7 @@ class FlavorsV2TestJSON(base.BaseComputeTest):
|
|||
@test.idempotent_id('935cf550-e7c8-4da6-8002-00f92d5edfaa')
|
||||
def test_list_flavors_filter_by_min_ram(self):
|
||||
# The list of flavors should be filtered by RAM
|
||||
flavor = self.client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.client.show_flavor(self.flavor_ref)
|
||||
flavor_id = flavor['id']
|
||||
|
||||
params = {self._min_ram: flavor['ram'] + 1}
|
||||
|
|
|
@ -67,7 +67,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
|
|||
self.addCleanup(self.client.delete_floating_ip,
|
||||
floating_ip_id_allocated)
|
||||
floating_ip_details = \
|
||||
self.client.get_floating_ip_details(floating_ip_id_allocated)
|
||||
self.client.show_floating_ip(floating_ip_id_allocated)
|
||||
# Checking if the details of allocated IP is in list of floating IP
|
||||
body = self.client.list_floating_ips()
|
||||
self.assertIn(floating_ip_details, body)
|
||||
|
@ -97,7 +97,7 @@ class FloatingIPsTestJSON(base.BaseFloatingIPsTest):
|
|||
self.server_id)
|
||||
|
||||
# Check instance_id in the floating_ip body
|
||||
body = self.client.get_floating_ip_details(self.floating_ip_id)
|
||||
body = self.client.show_floating_ip(self.floating_ip_id)
|
||||
self.assertEqual(self.server_id, body['instance_id'])
|
||||
|
||||
# Disassociation of floating IP that was associated in this method
|
||||
|
|
|
@ -63,7 +63,7 @@ class FloatingIPDetailsTestJSON(base.BaseV2ComputeTest):
|
|||
floating_ip_instance_id = body['instance_id']
|
||||
floating_ip_ip = body['ip']
|
||||
floating_ip_fixed_ip = body['fixed_ip']
|
||||
body = self.client.get_floating_ip_details(floating_ip_id)
|
||||
body = self.client.show_floating_ip(floating_ip_id)
|
||||
# Comparing the details of floating IP
|
||||
self.assertEqual(floating_ip_instance_id,
|
||||
body['instance_id'])
|
||||
|
|
|
@ -44,4 +44,4 @@ class FloatingIPDetailsNegativeTestJSON(base.BaseV2ComputeTest):
|
|||
else:
|
||||
non_exist_id = data_utils.rand_int_id(start=999)
|
||||
self.assertRaises(lib_exc.NotFound,
|
||||
self.client.get_floating_ip_details, non_exist_id)
|
||||
self.client.show_floating_ip, non_exist_id)
|
||||
|
|
|
@ -70,7 +70,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
|
|||
cls.server_id = server['id']
|
||||
|
||||
def _get_default_flavor_disk_size(self, flavor_id):
|
||||
flavor = self.flavors_client.get_flavor_details(flavor_id)
|
||||
flavor = self.flavors_client.show_flavor(flavor_id)
|
||||
return flavor['disk']
|
||||
|
||||
@test.idempotent_id('3731d080-d4c5-4872-b41a-64d0d0021314')
|
||||
|
|
|
@ -100,7 +100,7 @@ class ServersTestJSON(base.BaseV2ComputeTest):
|
|||
def test_verify_created_server_vcpus(self):
|
||||
# Verify that the number of vcpus reported by the instance matches
|
||||
# the amount stated by the flavor
|
||||
flavor = self.flavors_client.get_flavor_details(self.flavor_ref)
|
||||
flavor = self.flavors_client.show_flavor(self.flavor_ref)
|
||||
linux_client = remote_client.RemoteClient(self.server, self.ssh_user,
|
||||
self.password)
|
||||
self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
|
||||
|
|
|
@ -98,7 +98,7 @@ class BaremetalBasicOps(manager.BaremetalScenarioTest):
|
|||
def get_flavor_ephemeral_size(self):
|
||||
"""Returns size of the ephemeral partition in GiB."""
|
||||
f_id = self.instance['flavor']['id']
|
||||
flavor = self.flavors_client.get_flavor_details(f_id)
|
||||
flavor = self.flavors_client.show_flavor(f_id)
|
||||
ephemeral = flavor.get('OS-FLV-EXT-DATA:ephemeral')
|
||||
if not ephemeral or ephemeral == 'N/A':
|
||||
return None
|
||||
|
|
|
@ -65,7 +65,7 @@ class ImageUtils(object):
|
|||
|
||||
def is_flavor_enough(self, flavor_id, image_id):
|
||||
_image = self.images_client.show_image(image_id)
|
||||
_flavor = self.flavors_client.get_flavor_details(flavor_id)
|
||||
_flavor = self.flavors_client.show_flavor(flavor_id)
|
||||
return self._is_flavor_enough(_flavor, _image)
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from tempest.common import service_client
|
|||
|
||||
class FixedIPsClientJSON(service_client.ServiceClient):
|
||||
|
||||
def get_fixed_ip_details(self, fixed_ip):
|
||||
def show_fixed_ip(self, fixed_ip):
|
||||
url = "os-fixed-ips/%s" % (fixed_ip)
|
||||
resp, body = self.get(url)
|
||||
body = json.loads(body)
|
||||
|
|
|
@ -47,7 +47,7 @@ class FlavorsClientJSON(service_client.ServiceClient):
|
|||
self.validate_response(schema.list_flavors_details, resp, body)
|
||||
return service_client.ResponseBodyList(resp, body['flavors'])
|
||||
|
||||
def get_flavor_details(self, flavor_id):
|
||||
def show_flavor(self, flavor_id):
|
||||
resp, body = self.get("flavors/%s" % str(flavor_id))
|
||||
body = json.loads(body)
|
||||
self.validate_response(schema.create_get_flavor_details, resp, body)
|
||||
|
@ -84,7 +84,7 @@ class FlavorsClientJSON(service_client.ServiceClient):
|
|||
return service_client.ResponseBody(resp, body)
|
||||
|
||||
def is_resource_deleted(self, id):
|
||||
# Did not use get_flavor_details(id) for verification as it gives
|
||||
# Did not use show_flavor(id) for verification as it gives
|
||||
# 200 ok even for deleted id. LP #981263
|
||||
# we can remove the loop here and use get by ID when bug gets sortedout
|
||||
flavors = self.list_flavors_with_detail()
|
||||
|
@ -108,7 +108,7 @@ class FlavorsClientJSON(service_client.ServiceClient):
|
|||
resp, body)
|
||||
return service_client.ResponseBody(resp, body['extra_specs'])
|
||||
|
||||
def get_flavor_extra_spec(self, flavor_id):
|
||||
def list_flavor_extra_specs(self, flavor_id):
|
||||
"""Gets extra Specs details of the mentioned flavor."""
|
||||
resp, body = self.get('flavors/%s/os-extra_specs' % flavor_id)
|
||||
body = json.loads(body)
|
||||
|
@ -116,7 +116,7 @@ class FlavorsClientJSON(service_client.ServiceClient):
|
|||
resp, body)
|
||||
return service_client.ResponseBody(resp, body['extra_specs'])
|
||||
|
||||
def get_flavor_extra_spec_with_key(self, flavor_id, key):
|
||||
def show_flavor_extra_spec(self, flavor_id, key):
|
||||
"""Gets extra Specs key-value of the mentioned flavor and key."""
|
||||
resp, body = self.get('flavors/%s/os-extra_specs/%s' % (str(flavor_id),
|
||||
key))
|
||||
|
|
|
@ -35,7 +35,7 @@ class FloatingIPsClientJSON(service_client.ServiceClient):
|
|||
self.validate_response(schema.list_floating_ips, resp, body)
|
||||
return service_client.ResponseBodyList(resp, body['floating_ips'])
|
||||
|
||||
def get_floating_ip_details(self, floating_ip_id):
|
||||
def show_floating_ip(self, floating_ip_id):
|
||||
"""Get the details of a floating IP."""
|
||||
url = "os-floating-ips/%s" % str(floating_ip_id)
|
||||
resp, body = self.get(url)
|
||||
|
@ -90,7 +90,7 @@ class FloatingIPsClientJSON(service_client.ServiceClient):
|
|||
|
||||
def is_resource_deleted(self, id):
|
||||
try:
|
||||
self.get_floating_ip_details(id)
|
||||
self.show_floating_ip(id)
|
||||
except lib_exc.NotFound:
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -145,7 +145,7 @@ class FloatingStress(stressaction.StressAction):
|
|||
cli = self.manager.floating_ips_client
|
||||
|
||||
def func():
|
||||
floating = cli.get_floating_ip_details(self.floating['id'])
|
||||
floating = cli.show_floating_ip(self.floating['id'])
|
||||
return floating['instance_id'] is None
|
||||
|
||||
if not tempest.test.call_until_true(func, self.check_timeout,
|
||||
|
|
|
@ -96,7 +96,7 @@ class VolumeVerifyStress(stressaction.StressAction):
|
|||
cli = self.manager.floating_ips_client
|
||||
|
||||
def func():
|
||||
floating = cli.get_floating_ip_details(self.floating['id'])
|
||||
floating = cli.show_floating_ip(self.floating['id'])
|
||||
return floating['instance_id'] is None
|
||||
|
||||
if not tempest.test.call_until_true(func, CONF.compute.build_timeout,
|
||||
|
|
Loading…
Reference in New Issue