MCPcopy Create free account
hub / github.com/apache/cloudstack / test_02_import

Method test_02_import

test/integration/plugins/ldap/test_ldap.py:160–187  ·  view source on GitHub ↗

test if components are synced prerequisite a ldap host is configured a domain is linked to cloudstack

(self)

Source from the content-addressed store, hash-verified

158
159 @attr(tags=["smoke", "advanced"], required_hardware="false")
160 def test_02_import(self):
161 '''
162 test if components are synced
163
164 prerequisite
165 a ldap host is configured
166 a domain is linked to cloudstack
167 '''
168 domainid = self.importDomain.id
169
170 cmd = importLdapUsers.importLdapUsersCmd()
171 cmd.domainid = domainid
172 cmd.accounttype = 0
173 import_response = self.apiclient.importLdapUsers(cmd)
174
175 # this is needed purely for cleanup:
176 # cleanup
177 list_response = Account.list(self.apiclient, domainid=domainid)
178 for account in list_response:
179 account_created = Account(account.__dict__)
180 self.logger.debug("account to clean: %s (id: %s)" % (account_created.name, account_created.id))
181 self.cleanup.append(account_created)
182
183 self.assertEqual(len(import_response), len(self.testdata.testdata[LdapTestData.users]), "unexpected number of ldap users")
184
185 self.assertEqual(len(list_response), len(self.testdata.testdata[LdapTestData.users]), "only one account (for user %s) should be present" % self.test_user[1])
186
187 return
188
189 @attr(tags=["smoke", "advanced"], required_hardware="false")
190 def test_03_sync(self):

Callers

nothing calls this directly

Calls 5

AccountClass · 0.90
debugMethod · 0.80
assertEqualMethod · 0.80
listMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected