Issue #468
closedAdd non existent user to a role should return 400
Description
Description of problem:
http://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/role/cud.html#add-a-user-to-a-role
FAIL: test_08_add_unexistant_user (tests.test_06_roles.SimpleRoleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user/myprojects/pulp-automation/tests/test_06_roles.py", line 108, in test_08_add_unexistant_user
self.assertPulp(code=400)
File "/home/user/myprojects/pulp-automation/tests/pulp_test.py", line 57, in assertPulp
code
File "/home/ipanova/myprojects/pulp-automation/tests/pulp_test.py", line 66, in assertEqual
super(PulpTest, self).assertEqual(a, b, pprint.pformat("%r != %r" % (a, b)))
AssertionError: '404 != 400'
-------------------- >> begin captured logging << --------------------
urllib3.connectionpool: DEBUG: "POST /pulp/api/v2/roles/SimpleRoleTest_role/users/ HTTP/1.1" 404 439
pulp_auto.pulp: DEBUG: <pulp_auto.pulp.Pulp object at 0x19dd4d0>.send(Request('POST', u'/roles/SimpleRoleTest_role/users/', data='{"login": "Unexistant_user"}', headers={'Content-Type': 'application/json'})) == <Response [404]>
Version-Release number of selected component (if applicable):
2.4.0-0.23.beta
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
404 code is returned
Expected results:
400 code is returned
Additional info:
+ This bug was cloned from Bugzilla Bug #1116825 +
Updated by jcline@redhat.com almost 10 years ago
https://github.com/pulp/pulp/pull/1310
+ This comment was cloned from Bugzilla #1116825 comment 1 +
Updated by cduryee almost 10 years ago
fixed in pulp 2.6.0-0.2.beta
+ This comment was cloned from Bugzilla #1116825 comment 2 +
Updated by igulina@redhat.com almost 10 years ago
rpm -qa | grep pulp-server
pulp-server-2.6.0-0.2.beta.el6.noarch
curl -i -H "Accept: application/json" -X POST -k -u admin:admin -d '{"login": "test-user"}' 'https://localhost/pulp/api/v2/roles/test-role/users/'
HTTP/1.1 200 OK
Date: Fri, 26 Dec 2014 02:31:11 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 4
Connection: close
Content-Type: application/json
curl -i -H "Accept: application/json" -X POST -k -u admin:admi '{"login": "genka"}' 'https://localhost/pulp/api/v2/roles/test-role/users/'
HTTP/1.1 400 Bad Request
Date: Fri, 26 Dec 2014 02:31:24 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 378
Connection: close
Content-Type: application/json
{"http_request_method": "POST", "exception": null, "error_message": "Invalid properties: ['login']", "property_names": ["login"], "_href": "/pulp/api/v2/roles/test-role/users/", "http_status": 400, "error": {"code": "PLP0015", "data": {"property_names": ["login"], "properties": "['login']"}, "description": "Invalid properties: ['login']", "sub_errors": []}, "traceback": null}
+ This comment was cloned from Bugzilla #1116825 comment 3 +
Updated by rbarlow over 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
Updated by bmbouter over 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.