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
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 0000000..a4050a5
--- /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 bcdae44..ed6df47 100644
--- a/tempest/lib/services/image/v2/images_client.py
+++ b/tempest/lib/services/image/v2/images_client.py
@@ -161,7 +161,7 @@
"""
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):