diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-10-15 17:12:33 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-10-15 17:12:33 +0000 |
commit | 9aeebd7ce055de501aca771de92b858aa2046e2e (patch) | |
tree | 62bbc022a74ff6acb45288ea659e77acfbd35445 | |
parent | 7ac777a8a582173953abe8ce32f7e981c02fabf4 (diff) | |
parent | d2b9651cb82910b2b86b0f94af1721f717e74024 (diff) | |
download | tempest-9aeebd7ce055de501aca771de92b858aa2046e2e.tar.gz |
Merge "Make rest_client.wait_for_resource_deletion timeout error more specific"
24 files changed, 124 insertions, 3 deletions
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py index 00fe8d2c7..42e4f56fc 100644 --- a/tempest/common/rest_client.py +++ b/tempest/common/rest_client.py @@ -568,9 +568,10 @@ class RestClient(object): if self.is_resource_deleted(id): return if int(time.time()) - start_time >= self.build_timeout: - message = ('Failed to delete resource %(id)s within the ' - 'required time (%(timeout)s s).' % - {'id': id, 'timeout': self.build_timeout}) + message = ('Failed to delete %(resource_type)s %(id)s within ' + 'the required time (%(timeout)s s).' % + {'resource_type': self.resource_type, 'id': id, + 'timeout': self.build_timeout}) caller = misc_utils.find_test_caller() if caller: message = '(%s) %s' % (caller, message) @@ -585,6 +586,11 @@ class RestClient(object): % self.__class__.__name__) raise NotImplementedError(message) + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'resource' + @classmethod def validate_response(cls, schema, resp, body): # Only check the response if the status code is a success code diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py index 1cb010dbd..09927d343 100644 --- a/tempest/services/compute/json/aggregates_client.py +++ b/tempest/services/compute/json/aggregates_client.py @@ -79,6 +79,11 @@ class AggregatesClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'aggregate' + def add_host(self, aggregate_id, host): """Adds a host to the given aggregate.""" post_body = { diff --git a/tempest/services/compute/json/flavors_client.py b/tempest/services/compute/json/flavors_client.py index 5452f3a9d..8faf8a70a 100644 --- a/tempest/services/compute/json/flavors_client.py +++ b/tempest/services/compute/json/flavors_client.py @@ -99,6 +99,11 @@ class FlavorsClientJSON(rest_client.RestClient): return False return True + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'flavor' + def set_flavor_extra_spec(self, flavor_id, specs): """Sets extra Specs to the mentioned flavor.""" post_body = json.dumps({'extra_specs': specs}) diff --git a/tempest/services/compute/json/floating_ips_client.py b/tempest/services/compute/json/floating_ips_client.py index 8b020d07c..0ed1720db 100644 --- a/tempest/services/compute/json/floating_ips_client.py +++ b/tempest/services/compute/json/floating_ips_client.py @@ -102,6 +102,11 @@ class FloatingIPsClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'floating_ip' + def list_floating_ip_pools(self, params=None): """Returns a list of all floating IP Pools.""" url = 'os-floating-ip-pools' diff --git a/tempest/services/compute/json/images_client.py b/tempest/services/compute/json/images_client.py index 4af8331f0..079a91e74 100644 --- a/tempest/services/compute/json/images_client.py +++ b/tempest/services/compute/json/images_client.py @@ -143,3 +143,8 @@ class ImagesClientJSON(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'image' diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py index 29859a9bc..733a50bdf 100644 --- a/tempest/services/compute/json/security_groups_client.py +++ b/tempest/services/compute/json/security_groups_client.py @@ -143,3 +143,8 @@ class SecurityGroupsClientJSON(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'security_group' diff --git a/tempest/services/compute/json/volumes_extensions_client.py b/tempest/services/compute/json/volumes_extensions_client.py index 673e365bf..309dc5b1f 100644 --- a/tempest/services/compute/json/volumes_extensions_client.py +++ b/tempest/services/compute/json/volumes_extensions_client.py @@ -116,3 +116,8 @@ class VolumesExtensionsClientJSON(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume' diff --git a/tempest/services/compute/v3/json/aggregates_client.py b/tempest/services/compute/v3/json/aggregates_client.py index 960fe05df..e11ed45ff 100644 --- a/tempest/services/compute/v3/json/aggregates_client.py +++ b/tempest/services/compute/v3/json/aggregates_client.py @@ -79,6 +79,11 @@ class AggregatesV3ClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'aggregate' + def add_host(self, aggregate_id, host): """Adds a host to the given aggregate.""" post_body = { diff --git a/tempest/services/compute/v3/json/flavors_client.py b/tempest/services/compute/v3/json/flavors_client.py index d1eee5bde..fdca6b307 100644 --- a/tempest/services/compute/v3/json/flavors_client.py +++ b/tempest/services/compute/v3/json/flavors_client.py @@ -99,6 +99,11 @@ class FlavorsV3ClientJSON(rest_client.RestClient): return False return True + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'flavor' + def set_flavor_extra_spec(self, flavor_id, specs): """Sets extra Specs to the mentioned flavor.""" post_body = json.dumps({'extra_specs': specs}) diff --git a/tempest/services/compute/xml/aggregates_client.py b/tempest/services/compute/xml/aggregates_client.py index 9c2d4aa9e..47cde65e5 100644 --- a/tempest/services/compute/xml/aggregates_client.py +++ b/tempest/services/compute/xml/aggregates_client.py @@ -94,6 +94,11 @@ class AggregatesClientXML(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'aggregate' + def add_host(self, aggregate_id, host): """Adds a host to the given aggregate.""" post_body = xml_utils.Element("add_host", host=host) diff --git a/tempest/services/compute/xml/flavors_client.py b/tempest/services/compute/xml/flavors_client.py index 68ef3234e..63d1a4d10 100644 --- a/tempest/services/compute/xml/flavors_client.py +++ b/tempest/services/compute/xml/flavors_client.py @@ -136,6 +136,11 @@ class FlavorsClientXML(rest_client.RestClient): return False return True + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'flavor' + def set_flavor_extra_spec(self, flavor_id, specs): """Sets extra Specs to the mentioned flavor.""" extra_specs = xml_utils.Element("extra_specs") diff --git a/tempest/services/compute/xml/floating_ips_client.py b/tempest/services/compute/xml/floating_ips_client.py index 730e87049..84f06ab9f 100644 --- a/tempest/services/compute/xml/floating_ips_client.py +++ b/tempest/services/compute/xml/floating_ips_client.py @@ -108,6 +108,11 @@ class FloatingIPsClientXML(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'floating_ip' + def list_floating_ip_pools(self, params=None): """Returns a list of all floating IP Pools.""" url = 'os-floating-ip-pools' diff --git a/tempest/services/compute/xml/images_client.py b/tempest/services/compute/xml/images_client.py index 94acf3660..ce37b07f6 100644 --- a/tempest/services/compute/xml/images_client.py +++ b/tempest/services/compute/xml/images_client.py @@ -204,3 +204,8 @@ class ImagesClientXML(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'image' diff --git a/tempest/services/compute/xml/security_groups_client.py b/tempest/services/compute/xml/security_groups_client.py index 56ac7bae8..e52962337 100644 --- a/tempest/services/compute/xml/security_groups_client.py +++ b/tempest/services/compute/xml/security_groups_client.py @@ -159,3 +159,8 @@ class SecurityGroupsClientXML(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'security_group' diff --git a/tempest/services/compute/xml/volumes_extensions_client.py b/tempest/services/compute/xml/volumes_extensions_client.py index e9c5035a3..da1764ab7 100644 --- a/tempest/services/compute/xml/volumes_extensions_client.py +++ b/tempest/services/compute/xml/volumes_extensions_client.py @@ -141,3 +141,8 @@ class VolumesExtensionsClientXML(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume' diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py index bc5e04ace..d0d32e5d1 100644 --- a/tempest/services/image/v1/json/image_client.py +++ b/tempest/services/image/v1/json/image_client.py @@ -240,6 +240,11 @@ class ImageClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'image_meta' + def get_image_membership(self, image_id): url = 'v1/images/%s/members' % image_id resp, body = self.get(url) diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py index c420df905..486507391 100644 --- a/tempest/services/image/v2/json/image_client.py +++ b/tempest/services/image/v2/json/image_client.py @@ -117,6 +117,11 @@ class ImageClientV2JSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'image' + def store_image(self, image_id, data): url = 'v2/images/%s/file' % image_id headers = {'Content-Type': 'application/octet-stream'} diff --git a/tempest/services/volume/json/admin/volume_types_client.py b/tempest/services/volume/json/admin/volume_types_client.py index 44ef9febc..ca486d255 100644 --- a/tempest/services/volume/json/admin/volume_types_client.py +++ b/tempest/services/volume/json/admin/volume_types_client.py @@ -55,6 +55,11 @@ class VolumeTypesClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume-type/encryption-type' + def list_volume_types(self, params=None): """List all the volume_types created.""" url = 'types' diff --git a/tempest/services/volume/json/qos_client.py b/tempest/services/volume/json/qos_client.py index 6e0bee93d..b647bc7b1 100644 --- a/tempest/services/volume/json/qos_client.py +++ b/tempest/services/volume/json/qos_client.py @@ -38,6 +38,11 @@ class BaseQosSpecsClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'qos' + def wait_for_qos_operations(self, qos_id, operation, args=None): """Waits for a qos operations to be completed. diff --git a/tempest/services/volume/json/snapshots_client.py b/tempest/services/volume/json/snapshots_client.py index 1f8065baa..e9d5b83c4 100644 --- a/tempest/services/volume/json/snapshots_client.py +++ b/tempest/services/volume/json/snapshots_client.py @@ -138,6 +138,11 @@ class BaseSnapshotsClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume-snapshot' + def reset_snapshot_status(self, snapshot_id, status): """Reset the specified snapshot's status.""" post_body = json.dumps({'os-reset_status': {"status": status}}) diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py index c3a9269a6..cf2837b51 100644 --- a/tempest/services/volume/json/volumes_client.py +++ b/tempest/services/volume/json/volumes_client.py @@ -187,6 +187,11 @@ class BaseVolumesClientJSON(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume' + def extend_volume(self, volume_id, extend_size): """Extend a volume.""" post_body = { diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py index 679d0979e..2464016ba 100644 --- a/tempest/services/volume/xml/admin/volume_types_client.py +++ b/tempest/services/volume/xml/admin/volume_types_client.py @@ -205,3 +205,8 @@ class VolumeTypesClientXML(rest_client.RestClient): except exceptions.NotFound: return True return False + + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume-type' diff --git a/tempest/services/volume/xml/snapshots_client.py b/tempest/services/volume/xml/snapshots_client.py index ce98eea1d..fb591b112 100644 --- a/tempest/services/volume/xml/snapshots_client.py +++ b/tempest/services/volume/xml/snapshots_client.py @@ -153,6 +153,11 @@ class BaseSnapshotsClientXML(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume-snapshot' + def reset_snapshot_status(self, snapshot_id, status): """Reset the specified snapshot's status.""" post_body = common.Element("os-reset_status", status=status) diff --git a/tempest/services/volume/xml/volumes_client.py b/tempest/services/volume/xml/volumes_client.py index a8c1ae5a8..0fe7e0dbc 100644 --- a/tempest/services/volume/xml/volumes_client.py +++ b/tempest/services/volume/xml/volumes_client.py @@ -226,6 +226,11 @@ class BaseVolumesClientXML(rest_client.RestClient): return True return False + @property + def resource_type(self): + """Returns the primary type of resource this client works with.""" + return 'volume' + def attach_volume(self, volume_id, instance_uuid, mountpoint): """Attaches a volume to a given instance on a given mountpoint.""" post_body = common.Element("os-attach", |