You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/11/28 11:16:12 UTC

[jira] [Commented] (CLOUDSTACK-7989) [Automation]:test_ldap script execution is failing with cloudstackapi exception "

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-7989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14228212#comment-14228212 ] 

ASF subversion and git services commented on CLOUDSTACK-7989:
-------------------------------------------------------------

Commit 21a6bef53b05d430f2cff53ae37033432603136d in cloudstack's branch refs/heads/master from [~rohit.yadav@shapeblue.com]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=21a6bef ]

CLOUDSTACK-7989: Ignore Auth API calls in unauthenticated HTTP handlers

If an auth API call (such as login, logout) is called on unauthenticated port
such as the 8096 integration server port, we need to ignore such API calls
as calling auth APIs on 8096 is un-necessary and is undefined.

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


> [Automation]:test_ldap script execution is failing with cloudstackapi exception "
> ---------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-7989
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7989
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.5.0
>            Reporter: sadhu suresh
>            Assignee: Rohit Yadav
>
> 1.configure the ldap values(AD based) in test_data.py
> 2.run the ldap sscript
>  nosetests --with-marvin --marvin-config=sadhu_auto.cfg  sadhu-git/cloudstack/test/integration/component/test_l
> dap.py
> actual result:
> testcase failed with below exception:
> <marvin.cloudstackAPI.login.loginCmd object at 0x03441AD0> Exception: ['Traceback (most recent call last):\n', '  File "C:\\Python27\\lib\\site-packages\\marvin\\cloudstackConnection.py", line 374, in marvinRequest\n    raise self.__lastError\n', 'CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly\n']
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\marvin\cloudstackConnection.py", line 374, in marvinRequest
>     raise self.__lastError
> CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly
> est_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : createAccount=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?username=test&account=test&domainid=1&firstname=test&lastname=t&email=sadhu%40sadhu.com&command=createAccount&accounttype=0&password=password&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {primarystorageavailable : u'Unlimited', domain : u'ROOT', domainid : u'93519224-73d3-11e4-ae98-06f83c000036', vpclimit : u'Unlimited', iplimit : u'Unlimited', volumelimit : u'Unlimited', memorytotal : 0, secondarystorageavailable : u'Unlimited', vmtotal : 0, cputotal : 0, vpctotal : 0, id : u'73826d47-afb2-449c-8cbb-d3fdf970e824', cpuavailable : u'Unlimited', snapshotlimit : u'Unlimited', networklimit : u'Unlimited', iptotal : 0, volumetotal : 0, projectlimit : u'Unlimited', state : u'enabled', networktotal : 0, accounttype : 0, networkavailable : u'Unlimited', primarystoragetotal : 0, templatelimit : u'Unlimited', snapshottotal : 0, templateavailable : u'Unlimited', vmlimit : u'Unlimited', vpcavailable : u'Unlimited', memoryavailable : u'Unlimited', secondarystoragetotal : 0, templatetotal : 0, projecttotal : 0, user : [{username : u'test', account : u'test', domainid : u'93519224-73d3-11e4-ae98-06f83c000036', firstname : u'test', created : u'2014-11-28T03:33:36-0500', lastname : u't', domain : u'ROOT', id : u'd945726c-17ef-432e-a862-f3fa38910a04', iscallerchilddomain : False, state : u'enabled', accounttype : 0, email : u'sadhu@sadhu.com', isdefault : False, accountid : u'73826d47-afb2-449c-8cbb-d3fdf970e824'}], groups : [], projectavailable : u'Unlimited', isdefault : False, primarystoragelimit : u'Unlimited', secondarystoragelimit : u'Unlimited', volumeavailable : u'Unlimited', name : u'test', vmavailable : u'Unlimited', ipavailable : u'8', memorylimit : u'Unlimited', cpulimit : u'Unlimited', snapshotavailable : u'Unlimited'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: start test
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'name': 'ldap.basedn', 'value': 'CN=Users,DC=hyd-qa,DC=com', 'command': 'updateConfiguration', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : updateConfiguration=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?command=updateConfiguration&name=ldap.basedn&value=CN%3DUsers%2CDC%3Dhyd-qa%2CDC%3Dcom&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {category : u'Secure', name : u'ldap.basedn', value : u'CN=Users,DC=hyd-qa,DC=com', description : u'Sets the basedn for LDAP'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: updated the parameter ldap.basedn with value CN=Users,DC=hyd-qa,DC=com
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'name': 'ldap.email.attribute', 'value': 'mail', 'command': 'updateConfiguration', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : updateConfiguration=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?command=updateConfiguration&name=ldap.email.attribute&value=mail&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {category : u'Secure', name : u'ldap.email.attribute', value : u'mail', description : u'Sets the email attribute used within LDAP'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: updated the parameter ldap.email.attribute with value mail
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'name': 'ldap.user.object', 'value': 'user', 'command': 'updateConfiguration', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : updateConfiguration=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?command=updateConfiguration&name=ldap.user.object&value=user&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {category : u'Secure', name : u'ldap.user.object', value : u'user', description : u'Sets the object type of users within LDAP'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: updated the parameter ldap.user.object with value user
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'name': 'ldap.username.attribute', 'value': 'sAMAccountName', 'command': 'updateConfiguration', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : updateConfiguration=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?command=updateConfiguration&name=ldap.username.attribute&value=sAMAccountName&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {category : u'Secure', name : u'ldap.username.attribute', value : u'sAMAccountName', description : u'Sets the username attribute used within LDAP'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: updated the parameter ldap.username.attribute with value sAMAccountName
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: start addLdapConfiguration test
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: calling addLdapConfiguration API command
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'hostname': 'localhost', 'command': 'addLdapConfiguration', 'port': '389', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : addLdapConfiguration=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?hostname=localhost&command=addLdapConfiguration&port=389&response=json HTTP/1.1" 200 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Response : {hostname : u'localhost', port : 389}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: addLdapConfiguration was successful
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Ldap Configuration was succcessful
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Attempting to login.
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: Payload: {'username': 'test', 'command': 'login', 'password': 'aaaa_1111', 'response': 'json'}
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: ========Sending GET Cmd : login=======
> requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): localhost
> requests.packages.urllib3.connectionpool: DEBUG: "GET /client/api?username=test&password=aaaa_1111&command=login&response=json HTTP/1.1" 405 None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): ERROR: Exception:['Traceback (most recent call last):\n', '  File "C:\\Python27\\lib\\site-packages\\marvin\\cloudstackConnection.py", line 308, in __parseAndGetResponse\n    response_cls)\n', '  File "C:\\Python27\\lib\\site-packages\\marvin\\jsonHelper.py", line 150, in getResultObj\n    raise cloudstackException.CloudstackAPIException(respname, errMsg)\n', 'CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly\n']
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\marvin\cloudstackConnection.py", line 308, in __parseAndGetResponse
>     response_cls)
>   File "C:\Python27\lib\site-packages\marvin\jsonHelper.py", line 150, in getResultObj
>     raise cloudstackException.CloudstackAPIException(respname, errMsg)
> CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): ERROR: marvinRequest : CmdName: <marvin.cloudstackAPI.login.loginCmd object at 0x03441AD0> Exception: ['Traceback (most recent call last):\n', '  File "C:\\Python27\\lib\\site-packages\\marvin\\cloudstackConnection.py", line 374, in marvinRequest\n    raise self.__lastError\n', 'CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly\n']
> Traceback (most recent call last):
>   File "C:\Python27\lib\site-packages\marvin\cloudstackConnection.py", line 374, in marvinRequest
>     raise self.__lastError
> CloudstackAPIException: Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: login operation failed Execute cmd: login failed, due to: errorCode: 405, errorText:This is an authentication api, cannot be used directly
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: end of Login
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): DEBUG: None
> test_01_addLdapConfiguration (integration.component.test_ldap.TestLdap): CRITICAL: FAILED: test_01_addLdapConfiguration: ['Traceback (most recent call last):\n', '  File "C:\\Python27\\lib\\unittest\\case.py", line 327, in run\n    testMethod()\n', '  File "c:\\Users\\sadhu\\sadhu-git\\cloudstack\\test\\integration\\component\\test_ldap.py", line 117, in test_01_addLdapConfiguration\n    self.assertEquals(loginRes,1,"Ldap Authentication")\n', '  File "C:\\Python27\\lib\\unittest\\case.py", line 511, in assertEqual\n    assertion_func(first, second, msg=msg)\n', '  File "C:\\Python27\\lib\\unittest\\case.py", line 504, in _baseAssertEqual\n    raise self.failureException(msg)\n', 'AssertionError: Ldap Authentication\n']
> --------------------- >> end captured logging << ---------------------
> ----------------------------------------------------------------------
> Ran 1 test in 13.574s
> FAILED (failures=1)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)