File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 8
8
without cleaning any data
9
9
10
10
Tests/
11
- *
11
+ * added explicit reconnect tests for ReconnectLDAPObject
12
12
13
13
----------------------------------------------------------------
14
14
Released 2.4.45 2017-10-09
Original file line number Diff line number Diff line change 27
27
cn: %(rootcn)s
28
28
userPassword: %(rootpw)s
29
29
30
+ dn: cn=user1,%(suffix)s
31
+ objectClass: applicationProcess
32
+ objectClass: simpleSecurityObject
33
+ cn: user1
34
+ userPassword: user1_pw
35
+
30
36
dn: cn=Foo1,%(suffix)s
31
37
objectClass: organizationalRole
32
38
cn: Foo1
@@ -190,6 +196,22 @@ class Test02_ReconnectLDAPObject(Test01_SimpleLDAPObject):
190
196
191
197
ldap_object_class = ReconnectLDAPObject
192
198
199
+ def test_reconnect_sasl_external (self ):
200
+ l = self .ldap_object_class (self .server .ldapi_uri )
201
+ l .sasl_external_bind_s ()
202
+ authz_id = l .whoami_s ()
203
+ self .assertEqual (authz_id , 'dn:' + self .server .root_dn .lower ())
204
+ self .server .restart ()
205
+ self .assertEqual (l .whoami_s (), authz_id )
206
+
207
+ def test_reconnect_simple_bind (self ):
208
+ l = self .ldap_object_class (self .server .ldapi_uri )
209
+ bind_dn = 'cn=user1,' + self .server .suffix
210
+ l .simple_bind_s (bind_dn , 'user1_pw' )
211
+ self .assertEqual (l .whoami_s (), 'dn:' + bind_dn )
212
+ self .server .restart ()
213
+ self .assertEqual (l .whoami_s (), 'dn:' + bind_dn )
214
+
193
215
194
216
if __name__ == '__main__' :
195
217
unittest .main ()
You can’t perform that action at this time.
0 commit comments