test_create_server_with_unauthorized_image is failing

Bug #1039608 reported by David Kranz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Medium
Joe Gordon

Bug Description

This is now returning NotFound but the test is expecting BadRequest. This is probably a change in nova behavior.

======================================================================
ERROR: Server creation with another user's image should fail
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/tools.py", line 80, in newfunc
    func(*arg, **kw)
  File "/opt/stack/tempest/tempest/tests/compute/test_authorization.py", line 171, in test_create_server_with_unauthorized_image
    self.flavor_ref)
  File "/opt/stack/tempest/tempest/services/nova/json/servers_client.py", line 57, in create_server
    resp, body = self.post('servers', post_body, self.headers)
  File "/opt/stack/tempest/tempest/common/rest_client.py", line 154, in post
    return self.request('POST', url, headers, body)
  File "/opt/stack/tempest/tempest/common/rest_client.py", line 191, in request
    raise exceptions.NotFound(resp_body)
NotFound: Object not found
Details: Object not found
Details: {"itemNotFound": {"message": "The resource could not be found.", "code": 404}}
-------------------- >> begin captured logging << --------------------
tempest.common.rest_client: ERROR: Request URL: http://172.18.0.156:8774/v2/a6be48471f7a41b1a01a13016b904e06/servers
tempest.common.rest_client: ERROR: Request Body: {"server": {"flavorRef": "1", "name": "test", "imageRef": "13dd783e-f8c4-4a66-b798-486e850e4d55"}}
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 21 Aug 2012 15:46:03 GMT', 'status': '404', 'content-length': '78', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-0deb54b7-0663-461e-ae13-d2f2dc86cd27'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "The resource could not be found.", "code": 404}}
--------------------- >> end captured logging << ---------------------

Revision history for this message
Jay Pipes (jaypipes) wrote :

NotFound is the correct return code, not BadRequest. It's likely that Nova changed its behaviour to the correct NotFound return and we need to update Tempest to reflect this. In the future, however, there should be a skip in Tempest indicating a tracking bug, instead of simply having Tempest check for the wrong return code like BadRequest :)

Changed in tempest:
status: New → Triaged
importance: Undecided → Medium
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/12992

Changed in tempest:
assignee: nobody → Joe Gordon (joe-gordon0)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/12992
Committed: http://github.com/openstack/tempest/commit/406eb2a04c0cfa14477b5263c669c247330571e4
Submitter: Jenkins
Branch: master

commit 406eb2a04c0cfa14477b5263c669c247330571e4
Author: Joe Gordon <email address hidden>
Date: Thu Sep 13 14:58:23 2012 -0700

    Fix test_create_server_with_unauthorized_image

    Looks like nova is issuing a BadRequest again
    Fix bug 1039608

    Change-Id: I7956dd5d712c914102b37dbcfd934793680ee465

Changed in tempest:
status: In Progress → Fix Committed
Changed in tempest:
status: Fix Committed → Fix Released
Revision history for this message
Rohit Karajgi (rohitk) wrote :

The expected return code after the patch was submitted in https://review.openstack.org/12992 is still BadRequest.
The test expects a BadRequest, and it seems from the latest Tempest Devstack gate runs that Nova is also issuing BadRequest.

Looking at Jay's comment above, isn't this test supposed to validate for NotFound, (and Nova return a NotFound instead of BadRequest)
Has a bug been filed in Nova for this, or have I missed something here?

Revision history for this message
Jay Pipes (jaypipes) wrote :

After chatting with Brian Waldon on IRC, I've come to see the error of my original thought.

Since the original HTTP request is POST /servers, the 404 does not make sense as a return, since POST /servers is a valid URI resource. If the request was GET /images/<OTHER_TENANT_IMAGE_ID>, the return would be a 404, since it would not be a valid URI for that tenant.

Tempest is correct as-is.

Revision history for this message
Rohit Karajgi (rohitk) wrote :

Alright, thank you for the update.

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.