CLOUDSTACK-7431: moved ldap configuration details to test_data.py

Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
This commit is contained in:
SrikanteswaraRao Talluri 2014-09-04 17:38:42 +05:30
parent 3d369de6fe
commit b43d9345e9
2 changed files with 29 additions and 42 deletions

View File

@ -35,35 +35,6 @@ from marvin.lib.common import *
from nose.plugins.attrib import attr from nose.plugins.attrib import attr
import urllib import urllib
class Services:
"""Test LDAP Configuration
"""
def __init__(self):
self.services = {
"account": {
"email": "rmurphy@cloudstack.org",
"firstname": "Ryan",
"lastname": "Murphy",
"username": "rmurphy",
"password": "internalcloudstackpassword",
},
"ldapConfiguration_1":
{
"basedn": "dc=cloudstack,dc=org",
"emailAttribute": "mail",
"userObject": "inetOrgPerson",
"usernameAttribute": "uid",
"hostname": "localhost",
"port": "10389",
"ldapUsername": "rmurphy",
"ldapPassword": "password"
}
}
class TestLdap(cloudstackTestCase): class TestLdap(cloudstackTestCase):
""" """
This tests attempts to register a LDAP server and authenticate as an LDAP user. This tests attempts to register a LDAP server and authenticate as an LDAP user.
@ -72,12 +43,10 @@ class TestLdap(cloudstackTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
cls.api_client = super( testClient = super(TestLdap, cls).getClsTestClient()
TestLdap, cls.api_client = testClient.getApiClient()
cls cls.services = testClient.getParsedTestDataConfig()
).getClsTestClient().getApiClient() cls.account = cls.services["ldap_account"]
cls.services = Services().services
cls.account = cls.services["account"]
cls._cleanup = [] cls._cleanup = []
@ -97,12 +66,12 @@ class TestLdap(cloudstackTestCase):
self.acct = createAccount.createAccountCmd() self.acct = createAccount.createAccountCmd()
self.acct.accounttype = 0 self.acct.accounttype = 0
self.acct.firstname = self.services["account"]["firstname"] self.acct.firstname = self.services["ldap_account"]["firstname"]
self.acct.lastname = self.services["account"]["lastname"] self.acct.lastname = self.services["ldap_account"]["lastname"]
self.acct.password = self.services["account"]["password"] self.acct.password = self.services["ldap_account"]["password"]
self.acct.username = self.services["account"]["username"] self.acct.username = self.services["ldap_account"]["username"]
self.acct.email = self.services["account"]["email"] self.acct.email = self.services["ldap_account"]["email"]
self.acct.account = self.services["account"]["username"] self.acct.account = self.services["ldap_account"]["username"]
self.acct.domainid = 1 self.acct.domainid = 1
self.acctRes = self.apiClient.createAccount(self.acct) self.acctRes = self.apiClient.createAccount(self.acct)

View File

@ -1234,5 +1234,23 @@ test_data = {
}, },
}, },
"ostype": 'CentOS 5.6 (64-bit)', "ostype": 'CentOS 5.6 (64-bit)',
} },
"ldap_account": {
"email": "rmurphy@cloudstack.org",
"firstname": "Ryan",
"lastname": "Murphy",
"username": "rmurphy",
"password": "internalcloudstackpassword",
},
"ldapConfiguration_1":
{
"basedn": "dc=cloudstack,dc=org",
"emailAttribute": "mail",
"userObject": "inetOrgPerson",
"usernameAttribute": "uid",
"hostname": "localhost",
"port": "10389",
"ldapUsername": "rmurphy",
"ldapPassword": "password"
}
} }