From fd5a14b7383ac49ad4ffbef6ddcc8509222c030d Mon Sep 17 00:00:00 2001 From: zhufl Date: Fri, 16 Mar 2018 15:24:17 +0800 Subject: [PATCH] Fix expected response code of show_image_file According to https://developer.openstack.org/api-ref/image/v2/#download-binary-image-data, normal response codes of interface show_image_file should be [200, 204, 206], this is to fix it. Change-Id: I6eef7231742d873a0e727c300a9ae7f5958ac4f8 Closes-Bug: #1756264 --- .../fix-show-image-file-expected-code-92d97342d0f6d60e.yaml | 6 ++++++ tempest/lib/services/image/v2/images_client.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-show-image-file-expected-code-92d97342d0f6d60e.yaml diff --git a/releasenotes/notes/fix-show-image-file-expected-code-92d97342d0f6d60e.yaml b/releasenotes/notes/fix-show-image-file-expected-code-92d97342d0f6d60e.yaml new file mode 100644 index 0000000000..a4050a5624 --- /dev/null +++ b/releasenotes/notes/fix-show-image-file-expected-code-92d97342d0f6d60e.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fix show_image_file interface in v2 ImagesClient: Bug#1756264. + The expected success code of show_image_file is changed from + ``200`` to ``[200, 204, 206]``. diff --git a/tempest/lib/services/image/v2/images_client.py b/tempest/lib/services/image/v2/images_client.py index bcdae44542..ed6df47799 100644 --- a/tempest/lib/services/image/v2/images_client.py +++ b/tempest/lib/services/image/v2/images_client.py @@ -161,7 +161,7 @@ class ImagesClient(rest_client.RestClient): """ url = 'images/%s/file' % image_id resp, body = self.get(url) - self.expected_success(200, resp.status) + self.expected_success([200, 204, 206], resp.status) return rest_client.ResponseBodyData(resp, body) def add_image_tag(self, image_id, tag):