Project

Profile

Help

Issue #468

Add non existent user to a role should return 400

Added by ipanova@redhat.com almost 7 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.4 Beta
Platform Release:
2.6.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

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 +

History

#2 Updated by cduryee almost 7 years ago

fixed in pulp 2.6.0-0.2.beta

+ This comment was cloned from Bugzilla #1116825 comment 2 +

#3 Updated by igulina@redhat.com almost 7 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 +

#4 Updated by rbarlow almost 7 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#6 Updated by bmbouter almost 3 years ago

  • Severity set to 2. Medium

#7 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

#8 Updated by bmbouter over 1 year ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF