| 1 |
|
| 2 |
This document tries to descrive the test in this directory. Most of these |
| 3 |
tests should be self-explanitory as they should be simple unit tests of the |
| 4 |
shipped modules (more unit tests are welcome). |
| 5 |
|
| 6 |
Since nss-pam-ldapd is meant for providing data from an LDAP server for some |
| 7 |
tests you should have an LDAP server running and for other tests you also need |
| 8 |
to have nslcd (or pynslcd) running. |
| 9 |
|
| 10 |
For this a test environment should be set up (the tests are ignored if no such |
| 11 |
environment was detected). In my development environment I use a chroot jail |
| 12 |
with Debian. The instructions in this document assume a similar environment. |
| 13 |
|
| 14 |
|
| 15 |
TEST ENVIRONMENT |
| 16 |
================ |
| 17 |
|
| 18 |
LDAP server configuration |
| 19 |
------------------------- |
| 20 |
|
| 21 |
An LDAP server listening on ldap://localhost and ldapi:// is assumed that |
| 22 |
serves a particular test directory. For setting up an LDAP server for testing |
| 23 |
a setup_slapd.sh script is provided. This uses the config.ldif and test.ldif |
| 24 |
files to setup an LDAP server in a dedicated directory. |
| 25 |
|
| 26 |
If you have an LDAP server already set up on another machine with the test |
| 27 |
database, you should configure nslcd.conf and nslcd-test.conf to point to that |
| 28 |
server. |
| 29 |
|
| 30 |
Most of the names in the database have been randomly generated based on a |
| 31 |
combination of name-lists that were found on the Internet. |
| 32 |
|
| 33 |
|
| 34 |
nsswitch.conf |
| 35 |
------------- |
| 36 |
|
| 37 |
The /etc/nsswitch.conf file is expected to contain something like the |
| 38 |
following. All maps should be looked up through LDAP and some tests may expect |
| 39 |
the LDAP lookup to come after the files lookup. |
| 40 |
|
| 41 |
passwd: files ldap |
| 42 |
group: files ldap |
| 43 |
shadow: files ldap |
| 44 |
hosts: files ldap dns mdns |
| 45 |
networks: files ldap |
| 46 |
protocols: db files ldap |
| 47 |
services: db files ldap |
| 48 |
ethers: db files ldap |
| 49 |
rpc: db files ldap |
| 50 |
netgroup: files ldap |
| 51 |
aliases: files ldap |
| 52 |
|
| 53 |
nslcd.conf |
| 54 |
---------- |
| 55 |
|
| 56 |
The /etc/nslcd.conf file is expected to be configured like the following. |
| 57 |
|
| 58 |
uid nslcd |
| 59 |
gid nslcd |
| 60 |
uri ldapi:/// |
| 61 |
base dc=test,dc=tld |
| 62 |
#pagesize 100 # paging and referrals don't mix |
| 63 |
timelimit 2 |
| 64 |
bind_timelimit 4 |
| 65 |
reconnect_sleeptime 4 |
| 66 |
reconnect_retrytime 10 |
| 67 |
filter group (|(objectClass=posixGroup)(objectClass=groupOfNames)) |
| 68 |
base passwd ou=people,dc=test,dc=tld |
| 69 |
base shadow ou=people,dc=test,dc=tld |
| 70 |
base group ou=groups,dc=test,dc=tld |
| 71 |
rootpwmoddn cn=admin,dc=test,dc=tld |
| 72 |
rootpwmodpw test |