Commit 76691a81 authored by Xavier Guimard's avatar Xavier Guimard

e2e-tests now tests source tree (with its own webserver)

parent 8a47fccb
......@@ -216,8 +216,10 @@ extra_test: all
cd ${SRCPORTALDIR} && prove -b -I ../lemonldap-ng-common/blib/lib -I ../lemonldap-ng-handler/blib/lib -I../${SRCPORTALDIR}/blib/lib/ xt
# PERL_DL_NONLAZY=1 $(PERL) "-MExtUtils::Command::MM" "-e" "test_harness(0, 'lemonldap-ng-common/blib/lib', 'lemonldap-ng-handler/blib/lib', 'lemonldap-ng-manager/blib/lib', 'lemonldap-ng-portal/blib/lib')" extra-tests/*.t
e2e_test:
@mkdir -p e2e-tests/conf
e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_server
prepare_test_server:
@mkdir -p e2e-tests/conf/lock
$(MAKE) install_webserver_conf \
RCONFDIR=e2e-tests/conf \
ERASECONFIG=1 \
......@@ -227,15 +229,24 @@ e2e_test:
MANAGERPSGIDIR=`pwd`/e2e-tests \
DEFDOCDIR=`pwd`/doc \
FRDOCDIR=`pwd`/po-doc/fr
cp e2e-tests/lmConf-1.js e2e-tests/lemonldap-ng.ini e2e-tests/env.conf e2e-tests/conf/
perl -i -pe 'BEGIN{$$p=`pwd`;chomp $$p}s#__pwd__#$$p#;' e2e-tests/conf/lemonldap-ng.ini e2e-tests/conf/lmConf-1.js e2e-tests/conf/env.conf
start_web_server: prepare_test_server
# Start web server (designed for Debian, path may be broken else)
-@[ -e e2e-tests/conf/apache2.pid ] && kill `cat e2e-tests/conf/apache2.pid` && sleep 1
@/usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start
@LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start
launch_protractor:
# Start e2e tests
# NB: you must have protractor installed (using npm install -g protractor)
# and have run update-webdriver at least once
@protractor e2e-tests/protractor-conf.js
# Clean
stop_web_server:
# Stop web server
@kill `cat e2e-tests/conf/apache2.pid`
# Clean
@rm -rf e2e-tests/conf
#
......
......@@ -4,23 +4,20 @@ KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
HostnameLookups Off
LogLevel warn
LogLevel debug
Listen 127.0.0.1:19876
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
<IfVersion >= 2.3>
Require all denied
</IfVersion>
<IfVersion < 2.3>
Order Deny,Allow
Deny from all
</IfVersion>
</Directory>
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
......@@ -35,23 +32,26 @@ LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so
FcgidConnectTimeout 20
FcgidProcessTableFile conf/fcgid_shm
FcgidIPCDir conf/
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
Include conf/env.conf
AddHandler fcgid-script .fcgi
LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
TypesConfig /etc/mime.types
AddLanguage en .en
AddLanguage fr .fr
LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
<IfModule mpm_event_module>
StartServers 1
MinSpareThreads 2
MaxSpareThreads 4
ThreadLimit 64
ThreadsPerChild 4
MaxRequestWorkers 12
MaxConnectionsPerChild 0
</IfModule>
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule setenvif_module /usr/lib/apache2/modules/mod_setenvif.so
LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
<IfVersion >= 2.3>
LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
<IfModule mpm_event_module>
StartServers 1
MinSpareThreads 2
MaxSpareThreads 4
ThreadLimit 64
ThreadsPerChild 4
MaxRequestWorkers 12
MaxConnectionsPerChild 0
</IfModule>
</IfVersion>
IncludeOptional conf/manager-apache2.X.conf
IncludeOptional conf/portal-apache2.X.conf
FcgidInitialEnv LLNG_DEFAULTCONFFILE __pwd__/e2e-tests/conf/lemonldap-ng.ini
SetEnv LLNG_DEFAULTCONFFILE __pwd__/e2e-tests/conf/lemonldap-ng.ini
<perl>
use lib "__pwd__/lemonldap-ng-common/blib/lib";
use lib "__pwd__/lemonldap-ng-handler/blib/lib";
use lib "__pwd__/lemonldap-ng-portal/blib/lib";
use lib "__pwd__/lemonldap-ng-manager/blib/lib";
</perl>
[all]
[configuration]
type=File
dirName=__pwd__/e2e-tests/conf
loglevel = debug
[portal]
notification = 0
checkXSS = 0
portalSkin = pastel
[handler]
https = 0
;port = 8080
status = 0
useRedirectOnError = 0
[manager]
protection = manager
logLevel = error
staticPrefix = /static
languages = fr, en
templateDir = __pwd__/lemonldap-ng-manager/site/templates
[apply]
{
"applicationList": {
"0001-cat": {
"catname": "Sample applications",
"0002-app": {
"options": {
"description": "A simple application displaying authenticated user",
"display": "auto",
"logo": "demo.png",
"name": "Application Test 1",
"uri": "http://test1.example.com/"
},
"type": "application"
},
"0003-app": {
"options": {
"description": "The same simple application displaying authenticated user",
"display": "auto",
"logo": "thumbnail.png",
"name": "Application Test 2",
"uri": "http://test2.example.com/"
},
"type": "application"
},
"type": "category"
},
"0004-cat": {
"catname": "Administration",
"0005-app": {
"options": {
"description": "Configure LemonLDAP::NG WebSSO",
"display": "auto",
"logo": "configure.png",
"name": "WebSSO Manager",
"uri": "http://manager.example.com/"
},
"type": "application"
},
"0006-app": {
"options": {
"description": "Explore WebSSO notifications",
"display": "auto",
"logo": "database.png",
"name": "Notifications explorer",
"uri": "http://manager.example.com/notifications.pl"
},
"type": "application"
},
"0007-app": {
"options": {
"description": "Explore WebSSO sessions",
"display": "auto",
"logo": "database.png",
"name": "Sessions explorer",
"uri": "http://manager.example.com/sessions.pl"
},
"type": "application"
},
"type": "category"
},
"0008-cat": {
"catname": "Documentation",
"0009-app": {
"options": {
"description": "Documentation supplied with LemonLDAP::NG",
"display": "on",
"logo": "help.png",
"name": "Local documentation",
"uri": "http://manager.example.com/doc/"
},
"type": "application"
},
"0010-app": {
"options": {
"description": "Official LemonLDAP::NG Website",
"display": "on",
"logo": "network.png",
"name": "Offical Website",
"uri": "http://lemonldap-ng.org/"
},
"type": "application"
},
"type": "category"
}
},
"authentication": "Demo",
"cfgAuthor": "The LemonLDAP::NG team",
"cfgAuthorIP": "127.0.0.1",
"cfgDate": 1428138808,
"cfgLog": "Default configuration provided by LemonLDAP::NG team",
"cfgNum": "1",
"cookieName": "lemonldap",
"demoExportedVars": {
"cn": "cn",
"mail": "mail",
"uid": "uid"
},
"domain": "example.com",
"exportedHeaders": {
"test1.example.com": {
"Auth-User": "$uid"
},
"test2.example.com": {
"Auth-User": "$uid"
}
},
"exportedVars": {
"UA": "HTTP_USER_AGENT"
},
"globalStorage": "Apache::Session::File",
"globalStorageOptions": {
"Directory": "__pwd__/e2e-tests/conf",
"LockDirectory": "__pwd__/e2e-tests/conf/lock",
"generateModule": "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
},
"groups": {},
"key": "qwertyui",
"locationRules": {
"manager.example.com": {
"default": "$uid eq \"dwho\""
},
"test1.example.com": {
"^/logout": "logout_sso",
"default": "accept"
},
"test2.example.com": {
"^/logout": "logout_sso",
"default": "accept"
}
},
"loginHistoryEnabled": 1,
"macros": {
"_whatToTrace": "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\""
},
"notification": 1,
"notificationStorage": "File",
"notificationStorageOptions": {
"dirName": "__pwd__/e2e-tests/conf"
},
"passwordDB": "Demo",
"persistentStorage": "Apache::Session::File",
"persistentStorageOptions": {
"Directory": "__pwd__/e2e-tests/conf",
"LockDirectory": "__pwd__/e2e-tests/conf/lock",
"generateModule": "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
},
"portal": "http://auth.example.com:19876/",
"registerDB": "Null",
"reloadUrls": {
"reload.example.com": "http://reload.example.com/reload"
},
"securedCookie": 0,
"sessionDataToRemember": {},
"timeout": 72000,
"userDB": "Demo",
"whatToTrace": "_whatToTrace"
}
......@@ -6,10 +6,10 @@ BEGIN {
$pwd = `pwd`;
chomp $pwd;
eval qq{
use lib "$pwd/lemonldap-ng-common/blib/lib";
use lib "$pwd/lemonldap-ng-handler/blib/lib";
use lib "$pwd/lemonldap-ng-portal/blib/lib";
use lib "$pwd/lemonldap-ng-manager/blib/lib";
use lib "$pwd/../lemonldap-ng-common/blib/lib";
use lib "$pwd/../lemonldap-ng-handler/blib/lib";
use lib "$pwd/../lemonldap-ng-portal/blib/lib";
use lib "$pwd/../lemonldap-ng-manager/blib/lib";
};
die $@ if ($@);
}
......@@ -18,4 +18,11 @@ use Lemonldap::NG::Manager;
# Roll your own
my $server = Plack::Handler::FCGI->new();
#$server->run(
# sub {
# use Data::Dumper;
# return [ "200", [ 'Content-Type' => 'text/plain' ], [ Dumper(\@_,\%ENV) ] ];
# }
#);
$server->run( Lemonldap::NG::Manager->run( {} ) );
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