Commit d5d2816d authored by Johan Cwiklinski's avatar Johan Cwiklinski

Activate LDAP tests; setup OpenLDAP server

parent a40e5311
dist: precise
language: php
env:
- DB=mysql
before_script:
- ./tests/LDAP/ldap_run.sh
- composer self-update
- sed -e '/"php":/d' -i composer.json
- rm -f composer.lock
......@@ -20,9 +22,9 @@ before_script:
- php tools/cliinstall.php --db=glpitest --user=root --tests
- php tools/cliupdate.php --config-dir=../tests |grep -q "No migration needed." || (echo "tools/cliupdate.php FAILED" && exit 1)
- php -S localhost:8088 tests/router.php &>/dev/null &
# ldap disabled, fails with ubuntu precise env
# - phpenv config-add tests/enable-ldap.ini
# LDAP stuff
- phpenv config-add tests/enable-ldap.ini
- ./tests/LDAP/ldap_fixtures.sh
script:
- mysql -u root -e 'select version();'
- vendor/bin/atoum --debug --bootstrap-file tests/bootstrap.php --no-code-coverage --max-children-number 1 -d tests/database
......@@ -34,16 +36,44 @@ script:
matrix:
include:
- php: 5.6
addons:
apt:
packages:
- ldap-utils
- slapd
- php: 7.0
addons:
apt:
packages:
- ldap-utils
- slapd
- php: 7.1
addons:
mariadb: 10.0
apt:
packages:
- ldap-utils
- slapd
- php: 7.1
addons:
mariadb: 10.1
apt:
packages:
- ldap-utils
- slapd
- php: 7.1
env: CS=true
addons:
apt:
packages:
- ldap-utils
- slapd
- php: nightly
addons:
apt:
packages:
- ldap-utils
- slapd
allow_failures:
- php: nightly
......
#!/usr/bin/env bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
FIXTURES_DIR="$DIR/ldif"
load_fixture () {
ldapadd -x -H ldap://127.0.0.1:3890/ -D "cn=Manager,dc=glpi,dc=org" -w insecure -f $1
}
for FIXTURE in `ls ${FIXTURES_DIR}`
do
load_fixture "${FIXTURES_DIR}/${FIXTURE}"
done;
#!/usr/bin/env bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
LDAP_DB=/tmp/ldap_db
echo "Creating database directory"
rm -rf ${LDAP_DB} && mkdir ${LDAP_DB} && cp /usr/share/doc/slapd/examples/DB_CONFIG ${LDAP_DB}
echo "Launching OpenLDAP ..."
# Start slapd with non root privileges
slapd -h "ldap://0.0.0.0:3890/" -f ${DIR}/slapd.conf&
# Wait for LDAP to start
sleep 1
# See slapd.conf(5) for details on configuration options.
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/nis.schema
moduleload back_hdb
disallow bind_anon
database hdb
# The database directory MUST exist prior to running slapd AND
# change path as necessary
directory /tmp/ldap_db/
suffix "dc=glpi,dc=org"
rootdn "cn=Manager,dc=glpi,dc=org"
rootpw insecure
# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
access to attrs=userPassword,shadowLastChange
by anonymous auth
by self write
by * none
glpi-ldap.ldif provides :
tests/LDAP/ldif/glpi-ldap.ldif provides :
- 3 branches, to simulate 3 differents directories
- users stored in using 2 differents objectclasses : person & inetOrgPerson
- groups : groupOfNames & posixGroup
......@@ -77,4 +77,4 @@ Branch : ou=ldap2,dc=glpi,dc=org
=================================================
Branch : ou=ldap3,dc=glpi,dc=org
-works with objectclass inetOrgPerson & posixGroup
- more than 500 users (to address ldap's sizelimit)
\ No newline at end of file
- more than 500 users (to address ldap's sizelimit)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment