Context Navigation

Testing LDAP extensions

This page gives some hints about how to test the LdapPlugin extension, and provides some examples about deploying ​OpenLDAP to perform the ​tests.

Prerequistes

The examples in this page assume that you are working with a Linux server (Debian), with OpenLDAP 2.2 or greater.
The slapd server should have been installed and you should also have access to the Ldap utils (which usually comes with a separate package) namely:

Create the directory config file

The following config file is somewhat more complex than it could be, as it uses ACL, etc.
However this is a good base to elaborate a more complex LDAP setup and ... that's the file I use to test the extension ;-)

You should include this file from the main OpenLDAP configuration file, usually located here: /etc/ldap/slapd.conf.
You need to include these definitions at the bottom of the file.

Configure your system logger

OpenLDAP errors are somewhat cryptic. You can find useful information in the log produced by the server.

It is very useful to compare requests made by standard utilities such as ldapsearch and the requests made by the extension:
If an ldapsearch request fails, blame your server configuration (or your directory content) not the Trac Ldap Extension ;-)

Add the following entry in /etc/syslog.conf

# Log OpenLDAP
local4.* -/var/log/openldap.all

Reload the syslog configuration

/etc/init.d/sysklogd reload

You probably want to open a console and keep dumping the log messages:

tail -f /var/log/openldap.all

Start up the LDAP server

Create the directory where the LDAP directory files will reside

mkdir /var/local/db/tracldap

Start up the server

/etc/init.d/slapd start

You should not get any error. If you get an error message (carefully check the log file), please fix up your LDAP configuration before resuming installation.

If everything is ok, shut down the server right now, because we need to initialize the LDAP directory

Initializing the directory

We need to create the top-most entry (the local root) of the LDAP hierarchical directory.