wrong test for test_create_missing_specs_name in test_qos_specs_manage.py

Bug #1370308 reported by Liyingjun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Liyingjun

Bug Description

Since the test is `test_create_missing_specs_name` [1], we should define the body like `body = {'qos_specs': {'a': 'b'}}`. If we use body={'foo': {'a': 'b'}}, the code even do not reach [2], and it is actually raised by a not valid body [3].

[1]: https://github.com/openstack/cinder/blob/master/cinder/tests/api/contrib/test_qos_specs_manage.py#L326
[2]: https://github.com/openstack/cinder/blob/master/cinder/api/contrib/qos_specs_manage.py#L131
[3]: https://github.com/openstack/cinder/blob/master/cinder/api/contrib/qos_specs_manage.py#L127

Liyingjun (liyingjun)
Changed in cinder:
assignee: nobody → Liyingjun (liyingjun)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
Vincent Hou (houshengbo) wrote :

I do not agree that this is a bug.
This test is named test_create_missing_specs_name, so missing the name "qos_specs" is exactly the intention. It means to raise an exception of HTTPBadRequest when "qos_specs" is missing.

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

Reviewed: https://review.openstack.org/122041
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ee6299620ec1ce5c5ff22e0888e00a70b840a708
Submitter: Jenkins
Branch: master

commit ee6299620ec1ce5c5ff22e0888e00a70b840a708
Author: liyingjun <email address hidden>
Date: Sat Sep 6 13:37:53 2014 +0800

    Use right body for test_create_missing_specs_name

    Since the test is `test_create_missing_specs_name`, we should define
    the the body like `body = {'qos_specs': {'a': 'b'}}`. And add a test
    to cover the invalid body case.

    Change-Id: Ib1cf9a8b5bfddc0091e28e3765a36c75044642f3
    Closes-bug: #1370308

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-rc1 → 2014.2
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.