Incorrect exception raised during create image , when invalid server UUID is passed

Bug #1005397 reported by Rohit Karajgi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Our tempest tests that validate return error codes fail for the following scenarios:

1. Pass a 35 character length or less server UUID during Create Image
2. Pass a 37 character length or more server UUID during Create Image

Expected Return Code: 400 BadRequest
Actual Return Code: 404 Not Found

Seems that the UUID gets truncated to 35 characters. A 400 BadRequest should be sent back
instead, if the UUID length is invalid.

----------------------------------------------

Return an error if Image ID passed is 35 characters or less ... FAIL

======================================================================
FAIL: Return an error if Image ID passed is 35 characters or less
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/tempest/tests/test_images.py", line 236, in test_create_image_specify_uuid_35_characters_or_less
    self.fail("Should return 400 Bad Request if server uuid is 35"
AssertionError: Should return 400 Bad Request if server uuid is 35 characters or less
-------------------- >> begin captured logging << --------------------
tempest.config: INFO: Using tempest config file /opt/stack/tempest/etc/tempest.conf
tempest.common.rest_client: ERROR: Request URL: http://10.2.3.164:8774/v2/e5eb2e14ed8a409d9b36db3fddb5a757/images/9ea13f87-88ff-420c-8822-4d7ee7352d51
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Mon, 28 May 2012 05:19:02 GMT', 'status': '404', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-f54fbe9d-6950-4bc7-b552-64aa9ece7ad7'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "Image not found.", "code": 404}}
tempest.common.rest_client: ERROR: Request URL: http://10.2.3.164:8774/v2/e5eb2e14ed8a409d9b36db3fddb5a757/servers/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/action
tempest.common.rest_client: ERROR: Request Body: {"createImage": {"name": "test-snap-34700744550"}}
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Mon, 28 May 2012 05:19:03 GMT', 'status': '404', 'content-length': '78', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-6c5b2d77-40dc-474d-81b4-76b24ae5b106'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "The resource could not be found.", "code": 404}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------

Return an error if Image ID passed is 37 characters or more ... FAIL

======================================================================
FAIL: Return an error if Image ID passed is 37 characters or more
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/tempest/tests/test_images.py", line 249, in test_create_image_specify_uuid_37_characters_or_more
    self.fail("Should return 400 Bad Request if server uuid is 37"
AssertionError: Should return 400 Bad Request if server uuid is 37 characters or more
-------------------- >> begin captured logging << --------------------
tempest.config: INFO: Using tempest config file /opt/stack/tempest/etc/tempest.conf
tempest.common.rest_client: ERROR: Request URL: http://10.2.3.164:8774/v2/e5eb2e14ed8a409d9b36db3fddb5a757/images/9ea13f87-88ff-420c-8822-4d7ee7352d51
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Mon, 28 May 2012 05:19:24 GMT', 'status': '404', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-9a98813c-7f9a-42fc-b694-86dc18bad970'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "Image not found.", "code": 404}}
tempest.common.rest_client: ERROR: Request URL: http://10.2.3.164:8774/v2/e5eb2e14ed8a409d9b36db3fddb5a757/servers/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/action
tempest.common.rest_client: ERROR: Request Body: {"createImage": {"name": "test-snap-20536932791"}}
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Mon, 28 May 2012 05:19:24 GMT', 'status': '404', 'content-length': '78', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-3fb8ad71-714d-4b93-8b70-63541b994fe3'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "The resource could not be found.", "code": 404}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 2 test in 0.984s

FAILED (failures=2)

Tags: ntt
Revision history for this message
Brian Waldon (bcwaldon) wrote :

404 is expected.

Changed in nova:
status: New → Invalid
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.