Bug 811985 - Adding user roles together with adding user itself doesn't seem to work. [NEEDINFO]
Summary: Adding user roles together with adding user itself doesn't seem to work.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Ori Liel
QA Contact:
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-12 13:07 UTC by Jaroslav Henner
Modified: 2012-08-21 10:32 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-30 07:49:14 UTC
oVirt Team: ---
eedri: needinfo? (edolinin)


Attachments (Terms of Use)

Description Jaroslav Henner 2012-04-12 13:07:25 UTC
Description of problem:
Adding user roles (by role name) together with adding user itself doesn't seem to work -- role seems to be not assigned.

Version-Release number of selected component (if applicable):
rhevm ic154.1

How reproducible:


Steps to Reproduce:
1. Post POST that adds user and assigns his role.
2. Observe the results.
  
Actual results:
role seems to be not assigned

Expected results:
role is assigned


Additional info:
2012-04-12 14:55:22,824 - MainThread - utils.test_runner - INFO - Running command: testStatus = addUser(ovirtsdk_backend, 'TRUE', user_name='osapir', domain='rhev.lab.eng.brq.redhat.com', groups='RDP-Group@rhev.lab.eng.brq.redhat.com/QA-All-Users', role='UserRole')
2012-04-12 14:55:22,833 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - http request, conn: <ovirtsdk.web.connection.Connection object at 0x7fce61efecd0>
2012-04-12 14:55:22,833 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - method: POST url: /api/users
2012-04-12 14:55:22,833 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - headers: {}
2012-04-12 14:55:22,833 - MainThread - ovirtsdk_backendovirtsdk_backend - DEBUG - body:
<user>
    <name>osapir</name>
    <user_name>osapir@rhev.lab.eng.brq.redhat.com</user_name>
    <roles>
        <role>
            <name>UserRole</name>
        </role>
    </roles>
    <groups>
        <group>
            <name>RDP-Group@rhev.lab.eng.brq.redhat.com/QA-All-Users</name>
        </group>
    </groups>
</user>

curl https://jh-rhsetup.rhev.lab.eng.brq.redhat.com:8443/api/users/735fad3d-f56d-4612-a4d9-854104d13923/roles --basic -u *@* -k
Enter host password for user '*@*':
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<roles/>



`--> ssh jh-rh tail -fn0 /var/log/rhevm/rhevm.log | tee /tmp/logs/rhevm.log
2012-04-12 14:55:22,611 INFO  [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http-0.0.0.0-8443-1) Running command: LoginAdminUserCommand internal: false.
2012-04-12 14:55:22,628 INFO  [org.ovirt.engine.core.bll.LogoutUserCommand] (http-0.0.0.0-8443-1) Running command: LogoutUserCommand internal: false.
2012-04-12 14:55:22,786 INFO  [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http-0.0.0.0-8443-21) Running command: LoginAdminUserCommand internal: false.
2012-04-12 14:55:22,801 INFO  [org.ovirt.engine.core.bll.LogoutUserCommand] (http-0.0.0.0-8443-21) Running command: LogoutUserCommand internal: false.
2012-04-12 14:55:23,021 INFO  [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http-0.0.0.0-8443-21) Running command: LoginAdminUserCommand internal: false.
2012-04-12 14:55:23,109 INFO  [org.ovirt.engine.core.bll.AddUserCommand] (http-0.0.0.0-8443-21) Running command: AddUserCommand internal: false. Entities affected :  ID: aaa00000-0000-0000-0000-123456789aaa Type: System
2012-04-12 14:55:23,129 INFO  [org.ovirt.engine.core.bll.LogoutUserCommand] (http-0.0.0.0-8443-21) Running command: LogoutUserCommand internal: false.
^CKilled by signal 2.

Comment 1 Yaniv Kaul 2012-04-18 08:13:44 UTC
regression?

Comment 2 Jaroslav Henner 2012-05-15 11:59:32 UTC
AFAIK It was not tested before. So no regression.

Comment 3 Michael Pasternak 2012-05-15 12:16:05 UTC
not sure it was ever implemented.

Comment 5 Michael Pasternak 2012-07-30 07:49:14 UTC
this is non-restful and non-atomic operation, roles should be added to user
under /roles subcollection

Comment 6 Jaroslav Henner 2012-07-30 08:02:54 UTC
(In reply to comment #5)
> this is non-restful and non-atomic operation, roles should be added to user
> under /roles subcollection

Then ther is a bug in the doc. Am I right?

http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/html-single/REST_API_Guide/index.html#chap-REST_API_Guide-Users

Example 19.2. Adding a user from directory service and assigning two roles

Comment 7 Eyal Edri 2012-08-21 10:15:45 UTC
what's the status on his bug? 

we have a test failing in automation, so either we remove the test from automation code or apply a fix to the testing code.

failing test:

http://jenkins.eng.lab.tlv.redhat.com/view/Automation/view/rhevm_3.1/view/build%20branch%20+%20latest%20vdsm/job/rhevm_3.1_automation_restapi/lastCompletedBuild/testReport/(root)/Users/__423___Create_user/

Comment 8 Michael Pasternak 2012-08-21 10:26:25 UTC
as you can see: CLOSED WONTFIX

Comment 9 Eyal Edri 2012-08-21 10:32:42 UTC
i see and understand.
but ci still failing, so testing code should be removed/altered.

i added needinfo for automation team to respond on this.


Note You need to log in before you can comment on or make changes to this bug.