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

Method test_01_manual

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

test if an account can be imported prerequisite a ldap host is configured a domain is linked to cloudstack

(self)

Source from the content-addressed store, hash-verified

122
123 @attr(tags=["smoke", "advanced"], required_hardware="false")
124 def test_01_manual(self):
125 '''
126 test if an account can be imported
127
128 prerequisite
129 a ldap host is configured
130 a domain is linked to cloudstack
131 '''
132 cmd = listLdapUsers.listLdapUsersCmd()
133 cmd.domainid = self.manualDomain.id
134 cmd.userfilter = "LocalDomain"
135 response = self.apiclient.listLdapUsers(cmd)
136 self.logger.info("users found for linked domain %s" % response)
137 self.assertEqual(len(response), len(self.testdata.testdata[LdapTestData.users]), "unexpected number (%d) of ldap users" % len(self.testdata.testdata[LdapTestData.users]))
138
139 cmd = ldapCreateAccount.ldapCreateAccountCmd()
140 cmd.domainid = self.manualDomain.id
141 cmd.accounttype = 0
142 cmd.username = self.test_user[1]
143 create_response = self.apiclient.ldapCreateAccount(cmd)
144
145 # cleanup
146 # last results id should be the account
147 list_response = Account.list(self.apiclient, id=create_response.id)
148 account_created = Account(list_response[0].__dict__)
149 self.cleanup.append(account_created)
150
151 self.assertEqual(len(create_response.user), 1, "only one user %s should be present" % self.test_user[1])
152
153 self.assertEqual(len(list_response),
154 1,
155 "only one account (for user %s) should be present" % self.test_user[1])
156
157 return
158
159 @attr(tags=["smoke", "advanced"], required_hardware="false")
160 def test_02_import(self):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected