Running test_update_volume_with_invalid_volume_id with volume microversion 3.59 fails

Bug #1881866 reported by zhufl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
zhufl

Bug Description

1.Problem
Running test_update_volume_with_invalid_volume_id with volume.min_microversion set to 3.59 in tempest.conf, it fails with:
  File "/tempest/lib/services/volume/v3/volumes_client.py", line 113, in update_volume
    resp, body = self.put('volumes/%s' % volume_id, put_body)
  File "/tempest/lib/common/rest_client.py", line 357, in put
    return self.request('PUT', url, extra_headers, headers, body, chunked)
  File "/tempest/lib/services/volume/base_client.py", line 37, in request
    resp, resp_body = super(BaseClient, self).request(
  File "/tempest/lib/common/rest_client.py", line 773, in request
    self._error_checker(resp, resp_body)
  File "/tempest/lib/common/rest_client.py", line 884, in _error_checker
    raise exceptions.BadRequest(resp_body, resp=resp)
tempest.lib.exceptions.BadRequest: Bad request
Details: {'code': 400, 'message': 'Invalid input for field/attribute volume. Value: {}. {} is not valid under any of the given schemas'}

2.Analysis
update_volume body is empty, so BadRequest is raised instead of NotFound

3.
We should pass update_volume body to the calling of update_volume, to avoid the BadRequest caused by empty update_volume body.

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

Fix proposed to branch: master
Review: https://review.opendev.org/733072

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

Reviewed: https://review.opendev.org/733072
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=0672955e15fd802a5d1f08481dd58408e1f3ec8c
Submitter: Zuul
Branch: master

commit 0672955e15fd802a5d1f08481dd58408e1f3ec8c
Author: zhufl <email address hidden>
Date: Wed Jun 3 16:41:03 2020 +0800

    Fix negative tests of update_volume for volume microversion 3.59

    In volume microversion 3.59, empty body of update_volume will
    cause BadRequest error,
    tempest.lib.exceptions.BadRequest: Bad request
    Details: {'code': 400, 'message': 'Invalid input for field/attribute
    volume. Value: {}. {} is not valid under any of the given schemas'},
    so this is to add update_volume body for the negative tests of
    updating volume with invalid volume id.

    Change-Id: I7ef3ce911960c12c3045e1aa136f2ae3ead6d715
    Closes-Bug: #1881866

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 26.0.0

This issue was fixed in the openstack/tempest 26.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.