Create flavor accepts invalid href

Bug #1381091 reported by Malini Kamalambal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppy
Confirmed
Low
Unassigned

Bug Description

POST /flavors accepts href values which are empty/ invalid (not in uri format) & returns success HTTP 204

Expected Result: HTTP 400 with appropriate error message.

See request/response details from the tests below.

root: INFO: ========================================================
root: INFO: Test Case....: test_create_flavor_negative_tests_1_empty_href
root: INFO: Created At...: 2014-10-14 10:23:37.110348
root: INFO: No Test description.
root: INFO: ========================================================
cafe.engine.http.client: DEBUG: (<tests.api.utils.client.PoppyClient object at 0x10689fbd0>, 'POST', 'http://0.0.0.0:8888/v1.0/flavors') {'headers': {'Content-Type': 'application/json', 'X-Project-Id': u'650278', 'X-Auth-Token': u'985a88c47abb4663981ca988eacbd1d1'}, 'params': {}, 'verify': False, 'data': '{"id": "b14a9e07-53ad-11e4-90bd-28cfe91478b9", "providers": [{"links": [{"href": "", "rel": "provider_url"}], "provider": "ChinaCache"}]}'}
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 0.0.0.0
requests.packages.urllib3.connectionpool: DEBUG: "POST /v1.0/flavors HTTP/1.1" 204 0
cafe.engine.http.client: DEBUG:
------------
REQUEST SENT
------------
request method..: POST
request url.....: http://0.0.0.0:8888/v1.0/flavors
request params..:
request headers.: {'Content-Length': '137', 'Accept-Encoding': 'gzip, deflate', 'X-Project-Id': u'650278', 'Accept': '*/*', 'User-Agent': 'python-requests/2.4.1 CPython/2.7.1 Darwin/11.4.2', 'Connection': 'keep-alive', 'X-Auth-Token': u'985a88c47abb4663981ca988eacbd1d1', 'Content-Type': 'application/json'}
request body....: {"id": "b14a9e07-53ad-11e4-90bd-28cfe91478b9", "providers": [{"links": [{"href": "", "rel": "provider_url"}], "provider": "ChinaCache"}]}

cafe.engine.http.client: DEBUG:
-----------------
RESPONSE RECEIVED
-----------------
response status..: <Response [204]>
response time....: 0.348796844482
response headers.: {'date': 'Tue, 14 Oct 2014 14:23:40 GMT', 'content-length': '4', 'location': 'http://0.0.0.0:8888/v1.0/flavors/b14a9e07-53ad-11e4-90bd-28cfe91478b9', 'server': 'WSGIServer/0.1 Python/2.7.1'}
response body....:

======================================================================
FAIL: test_create_flavor_negative_tests_6_invalid_href (tests.api.flavors.test_flavors.TestCreateFlavors)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/ddt.py", line 114, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/malini.kamalambal/github/poppy/tests/api/flavors/test_flavors.py", line 69, in test_create_flavor_negative_tests
    self.assertEqual(resp.status_code, 400)
AssertionError: 204 != 400
-------------------- >> begin captured logging << --------------------
root: INFO: ========================================================
root: INFO: Test Case....: test_create_flavor_negative_tests_6_invalid_href
root: INFO: Created At...: 2014-10-14 12:54:48.540013
root: INFO: No Test description.
root: INFO: ========================================================
cafe.engine.http.client: DEBUG: (<tests.api.utils.client.PoppyClient object at 0x10a15fbd0>, 'POST', 'http://0.0.0.0:8888/v1.0/flavors') {'headers': {'Content-Type': 'application/json', 'X-Project-Id': u'650278', 'X-Auth-Token': u'985a88c47abb4663981ca988eacbd1d1'}, 'params': {}, 'verify': False, 'data': '{"id": "cf5af3f3-53c2-11e4-8fbf-28cfe91478b9", "limits": null, "providers": [{"links": [{"href": "watermelon", "rel": "provider_url"}], "provider": "ChinaCache"}]}'}
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 0.0.0.0
requests.packages.urllib3.connectionpool: DEBUG: "POST /v1.0/flavors HTTP/1.1" 204 0
cafe.engine.http.client: DEBUG:
------------
REQUEST SENT
------------
request method..: POST
request url.....: http://0.0.0.0:8888/v1.0/flavors
request params..:
request headers.: {'Content-Length': '163', 'Accept-Encoding': 'gzip, deflate', 'X-Project-Id': u'650278', 'Accept': '*/*', 'User-Agent': 'python-requests/2.4.1 CPython/2.7.1 Darwin/11.4.2', 'Connection': 'keep-alive', 'X-Auth-Token': u'985a88c47abb4663981ca988eacbd1d1', 'Content-Type': 'application/json'}
request body....: {"id": "cf5af3f3-53c2-11e4-8fbf-28cfe91478b9", "limits": null, "providers": [{"links": [{"href": "watermelon", "rel": "provider_url"}], "provider": "ChinaCache"}]}

cafe.engine.http.client: DEBUG:
-----------------
RESPONSE RECEIVED
-----------------
response status..: <Response [204]>
response time....: 0.0130360126495
response headers.: {'date': 'Tue, 14 Oct 2014 16:54:49 GMT', 'content-length': '4', 'location': 'http://0.0.0.0:8888/v1.0/flavors/cf5af3f3-53c2-11e4-8fbf-28cfe91478b9', 'server': 'WSGIServer/0.1 Python/2.7.1'}
response body....:

summary: - Create flavor accepts empty href
+ Create flavor accepts empty href & invalid href
description: updated
Revision history for this message
Amit Gandhi (amit-gandhi) wrote : Re: Create flavor accepts empty href & invalid href

Handled the empty href issue.

The International Resource Identifier (IRI) validation remains to be done.

Changed in poppy:
importance: Undecided → Medium
status: New → Confirmed
summary: - Create flavor accepts empty href & invalid href
+ Create flavor accepts invalid href
Changed in poppy:
milestone: none → kilo-3
Changed in poppy:
assignee: nobody → miguel quintero (migmaqer)
Changed in poppy:
milestone: kilo-3 → liberty-1
Changed in poppy:
assignee: miguel quintero (migmaqer) → nobody
milestone: liberty-1 → none
Changed in poppy:
importance: Medium → Low
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.