File: HOWTO_SETUP_OPENLDAP_TESTCASE.txt

package info (click to toggle)
php-net-ldap2 2.3.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 824 kB
  • sloc: php: 3,175; xml: 888; sh: 99; makefile: 9
file content (64 lines) | stat: -rw-r--r-- 2,223 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
+----------------------------------------+
| Howto for a OpenLDAP based test server |
+----------------------------------------+


PREFACE
=======

This file describes briefly, how you can set up an OpenLDAP-based
test server where you can run the tests on.
The test cases and ini-files match this guide, so after following it,
you can readily start to run all tests out of the box.

 /!\  DO NOT DO THIS ON A PRODUCTION MACHINE OR  /!\
 /!\       ONE CONNECTED TO THE INTERNET         /!\

If you already have a test server in place, then:
 - You don't need to install or configure OpenLDAP
 - Adjust the DN in Net_LDAP2/trunk/tests/ldif_data/INITIAL_TESTDATA.ldif
   to match your tree
 - Adjust your ldapconfig.ini to match your servers setup




THE GUIDE
=========

0. PHP, phpunit
Of course you will need this to run the tests...


1. Install and configure OpenLDAP
Config:
 - base:           dc=example,dc=com
 - admin:          admin (will map to cn=admin,dc=example,dc=com)
 - admin-password: test

Needed schemas: core, inetorgperson
Note that the core schema is usually already present and you have good chances
that the inetorgperson one is there too.
You can apply the schema ldifs after the initial install of openldap with ldapadd:
  Net_LDAP2/trunk/tests$  ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif

A note for debian users:
Since some recent version the installer does not ask for the baseDN anymore.
Before using apt to install, you may need to manipulate the /etc/hosts, so the
command `dnsdomainname` will return 'example.com'. Then just do `apt-get install slapd`.
The other solution is to adjust all ldif files here and also the test case php scripts.


2. Import basic Net_LDAP2 test data
Net_LDAP2 provides an basic LDIF file that maps to the test cases initial config:
  Net_LDAP2/trunk/tests$ ldapadd -D cn=admin,dc=example,dc=com -W -H ldapi:/// -f ldif_data/INITIAL_TESTDATA.ldif


3. configure test suite
Copy the default config to a real one:
  Net_LDAP2/trunk/tests$ cp ldapconfig.ini.dist ldapconfig.ini


4. run the tests
 - all tests:       Net_LDAP2/trunk/tests$ phpunit AllTests.php
 - a specific test: Net_LDAP2/trunk/tests$ phpunit Net_LDAP2_UtilTest.php