3535from nose .plugins .attrib import attr
3636import urllib
3737
38-
39-
40- class Services :
41- """Test LDAP Configuration
42- """
43-
44- def __init__ (self ):
45- self .services = {
46- "account" : {
47- "email" : "rmurphy@cloudstack.org" ,
48- "firstname" : "Ryan" ,
49- "lastname" : "Murphy" ,
50- "username" : "rmurphy" ,
51- "password" : "internalcloudstackpassword" ,
52- },
53- "ldapConfiguration_1" :
54- {
55- "basedn" : "dc=cloudstack,dc=org" ,
56- "emailAttribute" : "mail" ,
57- "userObject" : "inetOrgPerson" ,
58- "usernameAttribute" : "uid" ,
59- "hostname" : "localhost" ,
60- "port" : "10389" ,
61- "ldapUsername" : "rmurphy" ,
62- "ldapPassword" : "password"
63- }
64- }
65-
66-
6738class TestLdap (cloudstackTestCase ):
6839 """
6940 This tests attempts to register a LDAP server and authenticate as an LDAP user.
@@ -72,12 +43,10 @@ class TestLdap(cloudstackTestCase):
7243 @classmethod
7344 def setUpClass (cls ):
7445
75- cls .api_client = super (
76- TestLdap ,
77- cls
78- ).getClsTestClient ().getApiClient ()
79- cls .services = Services ().services
80- cls .account = cls .services ["account" ]
46+ testClient = super (TestLdap , cls ).getClsTestClient ()
47+ cls .api_client = testClient .getApiClient ()
48+ cls .services = testClient .getParsedTestDataConfig ()
49+ cls .account = cls .services ["ldap_account" ]
8150 cls ._cleanup = []
8251
8352
@@ -97,12 +66,12 @@ def setUp(self):
9766
9867 self .acct = createAccount .createAccountCmd ()
9968 self .acct .accounttype = 0
100- self .acct .firstname = self .services ["account " ]["firstname" ]
101- self .acct .lastname = self .services ["account " ]["lastname" ]
102- self .acct .password = self .services ["account " ]["password" ]
103- self .acct .username = self .services ["account " ]["username" ]
104- self .acct .email = self .services ["account " ]["email" ]
105- self .acct .account = self .services ["account " ]["username" ]
69+ self .acct .firstname = self .services ["ldap_account " ]["firstname" ]
70+ self .acct .lastname = self .services ["ldap_account " ]["lastname" ]
71+ self .acct .password = self .services ["ldap_account " ]["password" ]
72+ self .acct .username = self .services ["ldap_account " ]["username" ]
73+ self .acct .email = self .services ["ldap_account " ]["email" ]
74+ self .acct .account = self .services ["ldap_account " ]["username" ]
10675 self .acct .domainid = 1
10776
10877 self .acctRes = self .apiClient .createAccount (self .acct )
0 commit comments