test_deactivate_reactivate_image fails with Unexpected http success status code

Bug #1756264 reported by zhufl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Ken'ichi Ohmichi

Bug Description

1. Problem
Running test_deactivate_reactivate_image fails with
Traceback (most recent call last):
  File "/home/tempest/api/image/v2/test_images.py", line 158, in test_deactivate_reactivate_image
    body = self.client.show_image_file(image[\'id\'])
  File "/home/tempest/lib/services/image/v2/images_client.py", line 164, in show_image_file
    self.expected_success(200, resp.status)
  File "/home/tempest/lib/common/rest_client.py", line 269, in expected_success
    raise exceptions.InvalidHttpSuccessCode(details)
InvalidHttpSuccessCode: The success code is different than the expected one
Details: Unexpected http success status code 204, The expected status code is 200

2. Analysis
https://developer.openstack.org/api-ref/image/v2/#download-binary-image-data
shows "Normal response codes: 200, 204, 206", so both 200 and 204 should be ok

3 Solution
Change expected code of show_image_file to [200, 204, 206]

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/553705

Changed in tempest:
assignee: nobody → zhufl (zhu-fanglei)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tempest (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/554661

Changed in tempest:
assignee: zhufl (zhu-fanglei) → Ken'ichi Ohmichi (oomichi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/553705
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=fd5a14b7383ac49ad4ffbef6ddcc8509222c030d
Submitter: Zuul
Branch: master

commit fd5a14b7383ac49ad4ffbef6ddcc8509222c030d
Author: zhufl <email address hidden>
Date: Fri Mar 16 15:24:17 2018 +0800

    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

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tempest (master)

Reviewed: https://review.openstack.org/554661
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=3b79f17d34b8272c32e0c3b872085ffe94449579
Submitter: Zuul
Branch: master

commit 3b79f17d34b8272c32e0c3b872085ffe94449579
Author: Ken'ichi Ohmichi <email address hidden>
Date: Tue Mar 20 11:31:44 2018 -0700

    Check status code when downloading empty file

    According to
    https://developer.openstack.org/api-ref/image/v2/#download-binary-image-data
    The status code of Glance API is 204 when downloading empty file, so
    this patch adds the corresponding check on a test.

    This patch comes from I6eef7231742d873a0e727c300a9ae7f5958ac4f8

    Change-Id: Ia45b584e3783c6ab6d7c94a817da9b5058f1c351
    Related-Bug: #1756264

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 19.0.0

This issue was fixed in the openstack/tempest 19.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.