Skip to content

Commit e65b276

Browse files
committed
Add test case for TLS over LDAPI
Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 478f0b4 commit e65b276

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Tests/t_ldapobject.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,17 @@ def test_slapadd(self):
531531
("myAttribute", b'foobar'),
532532
])
533533

534+
@requires_tls()
535+
@requires_ldapi()
536+
def test_ldapi_tls(self):
537+
l = self.ldap_object_class(self.server.ldapi_uri)
538+
l.set_option(ldap.OPT_X_TLS_CACERTFILE, self.server.cafile)
539+
# l.set_option(ldap.OPT_HOST_NAME, self.server.hostname)
540+
l.set_option(ldap.OPT_HOST_NAME, "localhost")
541+
l.set_option(ldap.OPT_X_TLS_NEWCTX, 0)
542+
l.start_tls_s()
543+
self.assertEqual(l.whoami_s(), '')
544+
534545

535546
class Test01_ReconnectLDAPObject(Test00_SimpleLDAPObject):
536547
"""

0 commit comments

Comments
 (0)