Different patterns for ussage of method 'expected_success'

Bug #1354389 reported by Timur Nurlygayanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Low
Timur Nurlygayanov

Bug Description

We have common method 'expected_success' which allows to check the status code from responces.
But we can see that we have many tests in tempest, where we use this method with incorect arguments - we use resp instead of resp.status in arguments and in the result we will see that this method will do not check status code, when we use resp instead of resp.status:
https://github.com/openstack/tempest/blob/master/tempest/common/rest_client.py#L208

Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :

root@comp:~/tempest# grep -e "resp)" -r ./ | grep expected_success
./tempest/services/compute/xml/images_client.py: self.expected_success(200, resp)
./tempest/services/compute/json/images_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(204, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(200, resp)
./tempest/services/orchestration/json/orchestration_client.py: self.expected_success(204, resp)

Changed in tempest:
assignee: nobody → Timur Nurlygayanov (tnurlygayanov)
status: New → Confirmed
description: updated
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/112828

Changed in tempest:
status: Confirmed → In Progress
summary: - Different patterns for ussage of method '
+ Different patterns for ussage of method 'expected_success'
Changed in tempest:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/112828
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=8f79850de98ea2c89c15f1f82811935dafa57c31
Submitter: Jenkins
Branch: master

commit 8f79850de98ea2c89c15f1f82811935dafa57c31
Author: TimurNurlygayanov <email address hidden>
Date: Fri Aug 8 15:09:32 2014 +0400

    Fix arguments for method expected_success

    In expected_success method we expect to get status code of
    API response, but we use incorrect argument 'resp' instead
    of 'resp.status' in several files.

    Change-Id: I28f9e4862ddd42322757f5b206ddfb6ddabcfe0f
    Closes-Bug: #1354389

Changed in tempest:
status: In Progress → Fix Released
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.