|
| 1 | +To ease testing LDAP-Setups we've created a vagrant-setup. |
| 2 | + |
| 3 | +Prerequisits: |
| 4 | +============= |
| 5 | + |
| 6 | +You will need vagrant on your box. Get it from https://www.vagrantup.com |
| 7 | + |
| 8 | +Usage: |
| 9 | +====== |
| 10 | + |
| 11 | +To use it follow these steps: |
| 12 | + |
| 13 | +* Create a Vagrant-file with the following content. |
| 14 | +* Go to that directory and run "vagrant up" |
| 15 | + |
| 16 | +``` |
| 17 | +$setup = <<<SETUP |
| 18 | +apt-get update |
| 19 | + |
| 20 | +DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils |
| 21 | + |
| 22 | +export SLAPPASS=`slappasswd -s password` |
| 23 | + |
| 24 | +echo "dn: olcDatabase={1}hdb,cn=config |
| 25 | +changetype: modify |
| 26 | +replace: olcSuffix |
| 27 | +olcSuffix: dc=nodomain |
| 28 | +- |
| 29 | +replace: olcRootDN |
| 30 | +olcRootDN: dc=admin,dc=nodomain |
| 31 | +- |
| 32 | +replace: olcRootPW |
| 33 | +olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:/// |
| 34 | + |
| 35 | +echo "dn: dc=nodomain |
| 36 | +objectClass: dcObject |
| 37 | +objectClass: organization |
| 38 | +o: Example |
| 39 | +dc: example |
| 40 | + |
| 41 | +dn: ou=extldap,dc=nodomain |
| 42 | +objectClass: organizationalUnit |
| 43 | +ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password |
| 44 | +SETUP |
| 45 | + |
| 46 | +Vagrant.configure(2) do |config| |
| 47 | + config.vm.box = "ubuntu/trusty64" |
| 48 | + config.vm.network "private_network", ip: "192.168.33.10" |
| 49 | + config.vm.provision "shell", inline: $setup |
| 50 | +end |
| 51 | +``` |
| 52 | + |
| 53 | +Now you will have a virtual machine up and running on IP-Address 192.168.10.33 listening on port 369 for incomming LDAP-connections. The machine is already configured to execute the LDAP-Tests |
| 54 | + |
| 55 | +The next step is to go into the PHP-Source-directory. Configure and make the source as appropriate. |
| 56 | + |
| 57 | +Before running the LDAP-Tests you need to set some environment-variables: |
| 58 | + |
| 59 | +export LDAP_TEST_PASSWD="password" |
| 60 | +export LDAP_TEST_BASE="ou=extldap,dc=nodomain" |
| 61 | +export LDAP_TEST_USER="dc=admin,dc=nodomain" |
| 62 | +export LDAP_TEST_HOST=192.168.33.10 |
| 63 | + |
| 64 | +Now you can run the test-suite by calling "make test". To test only the LDAP-Tests, run "make test TESTS=ext/ldap" |
| 65 | + |
| 66 | +CAVEAT: The current setup does not (yet) test secure connections. |
| 67 | + |
| 68 | + |
| 69 | +======== |
| 70 | +OLD README |
| 71 | + |
1 | 72 | Most tests here relies on the availability of an LDAP server configured with TLS.
|
2 | 73 |
|
3 | 74 | Client/Server configuration:
|
|
0 commit comments