From ee05cf7fe897577ec40fae18a14f04e219a5e6be Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Thu, 21 Apr 2016 18:13:17 +0900 Subject: [PATCH] Fix usage of rest_client expected_success() in tests rest_client expected_success() method expect read_code must be int and states the same in doc string . Tempest is converting that to error instead of false pass. Details: I3f4c58bdbb172805514831103927d3464d65d7f3 Baremetal tests are still needed and running for Ironic stable branches so need to fix these. Change-Id: I31f90dc69c36368ce12ccfe93ed477f7d818ef6c --- tempest/services/baremetal/base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tempest/services/baremetal/base.py b/tempest/services/baremetal/base.py index 6e248014d..2bdd092b1 100644 --- a/tempest/services/baremetal/base.py +++ b/tempest/services/baremetal/base.py @@ -111,7 +111,7 @@ class BaremetalClient(rest_client.RestClient): uri += "?%s" % urllib.urlencode(kwargs) resp, body = self.get(uri) - self.expected_success(200, resp['status']) + self.expected_success(200, resp.status) return resp, self.deserialize(body) @@ -127,7 +127,7 @@ class BaremetalClient(rest_client.RestClient): else: uri = self._get_uri(resource, uuid=uuid, permanent=permanent) resp, body = self.get(uri) - self.expected_success(200, resp['status']) + self.expected_success(200, resp.status) return resp, self.deserialize(body) @@ -145,7 +145,7 @@ class BaremetalClient(rest_client.RestClient): uri = self._get_uri(resource) resp, body = self.post(uri, body=body) - self.expected_success(201, resp['status']) + self.expected_success(201, resp.status) return resp, self.deserialize(body) @@ -160,7 +160,7 @@ class BaremetalClient(rest_client.RestClient): uri = self._get_uri(resource, uuid) resp, body = self.delete(uri) - self.expected_success(204, resp['status']) + self.expected_success(204, resp.status) return resp, body def _patch_request(self, resource, uuid, patch_object): @@ -176,7 +176,7 @@ class BaremetalClient(rest_client.RestClient): patch_body = json.dumps(patch_object) resp, body = self.patch(uri, body=patch_body) - self.expected_success(200, resp['status']) + self.expected_success(200, resp.status) return resp, self.deserialize(body) @handle_errors @@ -201,5 +201,5 @@ class BaremetalClient(rest_client.RestClient): put_body = json.dumps(put_object) resp, body = self.put(uri, body=put_body) - self.expected_success(202, resp['status']) + self.expected_success([202, 204], resp.status) return resp, body