tldap.test.slapd

Utilities for starting up a test slapd server and talking to it with ldapsearch/ldapadd.

class tldap.test.slapd.Slapd[source]

Controller class for a slapd instance, OpenLDAP’s server.

This class creates a temporary data store for slapd, runs it on a private port, and initialises it with a top-level dc and the root user.

When a reference to an instance of this class is lost, the slapd server is shut down.

classmethod check_paths()[source]

Checks that the configured executable paths look valid. If they don’t, then logs warning messages (not errors).

configure(cfg)[source]

Appends slapd.conf configuration lines to cfg. Also re-initializes any backing storage. Feel free to subclass and override this method.

ldapadd(ldif, extra_args=[])[source]

Runs ldapadd on this slapd instance, passing it the ldif content

restart()[source]

Restarts the slapd server; ERASING previous content. Starts the server even it if isn’t already running.

start()[source]

Starts the slapd server process running, and waits for it to come up.

started()[source]

This method is called when the LDAP server has started up and is empty. By default, this method adds the two initial objects, the domain object and the root user object.

stop()[source]

Stops the slapd server, and waits for it to terminate

wait()[source]

Waits for the slapd process to terminate by itself.

tldap.test.slapd.mkdirs(path)[source]

Creates the directory path unless it already exists

tldap.test.slapd.quote(s)[source]

Quotes the ‘”’ and ‘’ characters in a string and surrounds with ”...”

Previous topic

tldap.methods.shibboleth

This Page