Skip to content

Commit b43d934

Browse files
author
SrikanteswaraRao Talluri
committed
CLOUDSTACK-7431: moved ldap configuration details to test_data.py
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
1 parent 3d369de commit b43d934

2 files changed

Lines changed: 29 additions & 42 deletions

File tree

test/integration/component/test_ldap.py

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,6 @@
3535
from nose.plugins.attrib import attr
3636
import 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-
6738
class 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)

tools/marvin/marvin/config/test_data.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,5 +1234,23 @@
12341234
},
12351235
},
12361236
"ostype": 'CentOS 5.6 (64-bit)',
1237-
}
1237+
},
1238+
"ldap_account": {
1239+
"email": "rmurphy@cloudstack.org",
1240+
"firstname": "Ryan",
1241+
"lastname": "Murphy",
1242+
"username": "rmurphy",
1243+
"password": "internalcloudstackpassword",
1244+
},
1245+
"ldapConfiguration_1":
1246+
{
1247+
"basedn": "dc=cloudstack,dc=org",
1248+
"emailAttribute": "mail",
1249+
"userObject": "inetOrgPerson",
1250+
"usernameAttribute": "uid",
1251+
"hostname": "localhost",
1252+
"port": "10389",
1253+
"ldapUsername": "rmurphy",
1254+
"ldapPassword": "password"
1255+
}
12381256
}

0 commit comments

Comments
 (0)