Commit ecfb575e authored by Clément OUDOT's avatar Clément OUDOT

Add TESTBACKEND LDAP in Makefile (#1118)

parent fdfb2107
......@@ -114,6 +114,11 @@ VHOSTLISTEN="*:$(PORT)"
TESTWEBSERVER=apache
TESTWEBSERVERPORT=19876
# LDAP backend test
LLNGTESTLDAP_SLAPD_BIN:=/usr/sbin/slapd
LLNGTESTLDAP_SLAPADD_BIN:=/usr/sbin/slapdadd
LLNGTESTLDAP_SCHEMA_DIR:=/etc/slapd/schema
# Other
SRCCOMMONDIR=lemonldap-ng-common
SRCHANDLERDIR=lemonldap-ng-handler
......@@ -423,6 +428,21 @@ start_web_server: all prepare_test_server
lemonldap-ng-common/scripts/lemonldap-ng-cli --yes 1 \
addKey globalStorageOptions DataSource 'dbi:SQLite:dbname='`pwd`'/e2e-tests/conf/sessions.db'; \
fi
@if test "$(TESTBACKEND)" = "LDAP"; then \
cp lemonldap-ng-portal/t/testslapd/slapd.ldif e2e-tests/conf/; \
mkdir e2e-tests/conf/slapd.d; \
mkdir e2e-tests/conf/data; \
sed -i 's:__SCHEMA_DIR__:${LLNGTESTLDAP_SCHEMA_DIR}:' e2e-tests/conf/slapd.ldif; \
sed -i 's|olcDbDirectory.*|olcDbDirectory: e2e-tests/conf/data|' e2e-tests/conf/slapd.ldif; \
sed -i 's|olcPidFile.*|olcPidFile: e2e-tests/conf/slapd.pid|' e2e-tests/conf/slapd.ldif; \
${LLNGTESTLDAP_SLAPADD_BIN} -F e2e-tests/conf/slapd.d -n 0 -l e2e-tests/conf/slapd.ldif; \
${LLNGTESTLDAP_SLAPADD_BIN} -F e2e-tests/conf/slapd.d -n 1 -l lemonldap-ng-portal/t/testslapd/confs-sessions.ldif; \
${LLNGTESTLDAP_SLAPD_BIN} -s 256 -h "ldap://127.0.0.1:20389/" -F e2e-tests/conf/slapd.d; \
perl -Ilemonldap-ng-common/blib/lib ./lemonldap-ng-common/scripts/convertConfig \
--current=e2e-tests/conf/lemonldap-ng.ini \
--new=e2e-tests/conf/lemonldap-ng-ldap.ini; \
mv e2e-tests/conf/lemonldap-ng-ldap.ini e2e-tests/conf/lemonldap-ng.ini; \
fi
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` || true
-@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` || true
-@[ -e e2e-tests/conf/llng-fastcgi.pid ] && kill `cat e2e-tests/conf/llng-fastcgi.pid` && rm -f e2e-tests/conf/llng-fastcgi.pid || true
......@@ -471,6 +491,7 @@ stop_web_server:
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` || true
-@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` ||true
-@[ -e e2e-tests/conf/llng-fastcgi.pid ] && kill `cat e2e-tests/conf/llng-fastcgi.pid` && rm -f e2e-tests/conf/llng-fastcgi.pid || true
-@[ -e e2e-tests/conf/slapd.pid ] && kill `cat e2e-tests/conf/slapd.pid` || true
# Clean
@rm -rf e2e-tests/conf
......
[all]
logLevel = debug
;globalStorage = Apache::Session::SQLite3
;globalStorageOptions = { DataSource => 'dbi:SQLite:dbname=__pwd__/e2e-tests/conf/sessions.db' }
[configuration]
type = LDAP
ldapServer = ldap://localhost:20389
ldapConfBase = ou=configurations,dc=example,dc=com
ldapBindDN = cn=admin,dc=example,dc=com
ldapBindPassword = admin
[portal]
notification = 0
checkXSS = 0
portalSkin = bootstrap
staticPrefix = /static
languages = fr, en, vi, it
templateDir = __pwd__/lemonldap-ng-portal/site/templates
;u2fActivation = 1
;u2fSelfRegistration = 1
[handler]
https = 0
status = 1
useRedirectOnError = 0
[manager]
protection = manager
staticPrefix = /static
languages = fr, en, vi
templateDir = __pwd__/lemonldap-ng-manager/site/templates
[node-handler]
nodeVhosts = test2.example.com
dn: dc=example,dc=com
objectClass: top
objectClass: organization
objectClass: dcObject
dc: example
o: Example
dn: ou=sessions,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: sessions
dn: ou=configurations,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: configurations
......@@ -5,11 +5,6 @@ objectClass: dcObject
dc: example
o: Example
dn: ou=sessions,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: sessions
dn: ou=users,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
......
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