com php-src: Adapts the readme to the new test-possibility: ext/ldap/tests/README

From: Date: Sat, 07 Jan 2017 16:45:10 +0000
Subject: com php-src: Adapts the readme to the new test-possibility: ext/ldap/tests/README
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96606@lists.php.net to get a copy of this message
Commit: fc777296bfdf47f71de2db82cce95529b4784406 Author: Andreas Heigl <andreas@heigl.org> Mon, 6 Jul 2015 10:54:07 +0200 Committer: Joe Watkins <krakjoe@php.net> Sat, 7 Jan 2017 16:45:10 +0000 Parents: 486fc0424ab1664831ea098546e14dbf2809c637 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fc777296bfdf47f71de2db82cce95529b4784406 Log: Adapts the readme to the new test-possibility This commit introduces a way to use a vagrant setup to test against a known LDAP without the need to setup an LDAP on your own machine Changed paths: M ext/ldap/tests/README Diff: diff --git a/ext/ldap/tests/README b/ext/ldap/tests/README index 4f3b07d..edc44eb 100644 --- a/ext/ldap/tests/README +++ b/ext/ldap/tests/README @@ -1,3 +1,74 @@ +To ease testing LDAP-Setups we've created a vagrant-setup. + +Prerequisits: +============= + +You will need vagrant on your box. Get it from https://www.vagrantup.com + +Usage: +====== + +To use it follow these steps: + +* Create a Vagrant-file with the following content. +* Go to that directory and run "vagrant up" + +``` +$setup = <<<SETUP +apt-get update + +DEBIAN_FRONTEND=noninteractive aptitude install -q -y slapd ldap-utils + +export SLAPPASS=slappasswd -s password + +echo "dn: olcDatabase={1}hdb,cn=config +changetype: modify +replace: olcSuffix +olcSuffix: dc=nodomain +- +replace: olcRootDN +olcRootDN: dc=admin,dc=nodomain +- +replace: olcRootPW +olcRootPW: ${SLAPPASS}" | ldapmodify -Y EXTERNAL -H ldapi:/// + +echo "dn: dc=nodomain +objectClass: dcObject +objectClass: organization +o: Example +dc: example + +dn: ou=extldap,dc=nodomain +objectClass: organizationalUnit +ou: extldap" | ldapadd -c -x -H ldap://localhost:389 -D "dc=admin,dc=nodomain" -w password +SETUP + +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.network "private_network", ip: "192.168.33.10" + config.vm.provision "shell", inline: $setup +end +``` + +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 + +The next step is to go into the PHP-Source-directory. Configure and make the source as appropriate. + +Before running the LDAP-Tests you need to set some environment-variables: + +export LDAP_TEST_PASSWD="password" +export LDAP_TEST_BASE="ou=extldap,dc=nodomain" +export LDAP_TEST_USER="dc=admin,dc=nodomain" +export LDAP_TEST_HOST=192.168.33.10 + +Now you can run the test-suite by calling "make test". To test only the LDAP-Tests, run "make test TESTS=ext/ldap" + +CAVEAT: The current setup does not (yet) test secure connections. + + +======== +OLD README + Most tests here relies on the availability of an LDAP server configured with TLS. Client/Server configuration:

« previous php.cvs (#96606) next »