Comment 0 for bug 1005423

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

Our tempest test that validates a return error code when an invalid key-value pair for metadata is passed
during Create Image fails.

Steps to reproduce:
1. Create a server
2. Create an image of the above server and pass invalid metadata key value pair, for ex:
meta = {'': ''}

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

Besides, the Snapshot Image is created but the operation stays in Queued state.

Return an error when creating image with invalid metadata ... FAIL
======================================================================
FAIL: Return an error when creating image with invalid metadata
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/tempest/tests/test_images.py", line 276, in test_create_image_specify_invalid_metadata
    self.fail("Should raise 400 Bad Request if meta data is invalid")
AssertionError: Should raise 400 Bad Request if meta data is invalid
-------------------- >> 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 07:21:44 GMT', 'status': '404', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-921eda64-cfe2-43ff-a892-8fac1e9f9d67'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "Image not found.", "code": 404}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 31.507s

FAILED (failures=1)