From 0e5b06aec4ddf1743fe7e45928ca4cfea66a06d1 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Tue, 2 Feb 2016 06:17:08 +0000 Subject: [PATCH] Update e2e_tests --- Makefile | 3 +- _example/etc/handler-nginx.conf | 64 +++++++-------------------------- e2e-tests/apache2.conf | 6 ++-- e2e-tests/llng.psgi | 11 +++++- 4 files changed, 28 insertions(+), 56 deletions(-) diff --git a/Makefile b/Makefile index cf30b1fce..a4d1a3cb4 100644 --- a/Makefile +++ b/Makefile @@ -296,7 +296,7 @@ e2e_test: all prepare_test_server start_web_server launch_protractor stop_web_se prepare_test_server: @mkdir -p e2e-tests/conf/sessions/lock e2e-tests/conf/persistents/lock - @$(MAKE) install_webserver_conf \ + @$(MAKE) install_webserver_conf install_test_site \ RCONFDIR=e2e-tests/conf \ ERASECONFIG=1 \ VHOSTLISTEN='*:$(TESTWEBSERVERPORT)' \ @@ -304,6 +304,7 @@ prepare_test_server: PSGISERVERSOCKET=unix:`pwd`/e2e-tests/conf/llng.sock \ PORTALDIR=`pwd`/$(SRCPORTALDIR)/example \ MANAGERDIR=`pwd`/$(SRCMANAGERDIR)/site \ + TESTDIR=`pwd`/e2e-tests/conf/site \ MANAGERPSGIDIR=`pwd`/e2e-tests \ DEFDOCDIR=`pwd`/doc \ FRDOCDIR=`pwd`/po-doc/fr diff --git a/_example/etc/handler-nginx.conf b/_example/etc/handler-nginx.conf index 8e5df2958..12edcf3fd 100644 --- a/_example/etc/handler-nginx.conf +++ b/_example/etc/handler-nginx.conf @@ -1,67 +1,27 @@ server { listen __PORT__; - server_name test1.__DNSDOMAIN__; + server_name reload.__DNSDOMAIN__; root /var/www/html; - - # Internal authentication request - location = /lmauth { - internal; + location = /reload { + allow 127.0.0.1; + deny all; include /etc/nginx/fastcgi_params; fastcgi_pass __PSGISERVERSOCKET__; - - # Drop post datas - fastcgi_pass_request_body off; - fastcgi_param CONTENT_LENGTH ""; - - # Keep original hostname - fastcgi_param HOST $http_host; - - # Keep original request (LLNG server will received /llauth) - fastcgi_param X_ORIGINAL_URI $request_uri; - } # Client requests location / { - auth_request /lmauth; - auth_request_set $lmremote_user $upstream_http_lm_remote_user; - auth_request_set $lmlocation $upstream_http_location; - error_page 401 $lmlocation; - try_files $uri $uri/ =404; - - # Add as many 3-lines block as headers returned by configuration for this - # template - auth_request_set $headername1 $upstream_http_headername1; - auth_request_set $headervalue1 $upstream_http_headervalue1; - #proxy_set_header $headername1 $headervalue1; - # OR - #fastcgi_param $fheadername1 $headervalue1; - - auth_request_set $headername2 $upstream_http_headername2; - auth_request_set $headervalue2 $upstream_http_headervalue2; - #proxy_set_header $headername2 $headervalue2; - # OR - #fastcgi_param $fheadername2 $headervalue2; - - auth_request_set $headername3 $upstream_http_headername3; - auth_request_set $headervalue3 $upstream_http_headervalue3; - #proxy_set_header $headername3 $headervalue3; - # OR - #fastcgi_param $fheadername3 $headervalue3; - - auth_request_set $headername4 $upstream_http_headername4; - auth_request_set $headervalue4 $upstream_http_headervalue4; - #proxy_set_header $headername4 $headervalue4; - # OR - #fastcgi_param $fheadername4 $headervalue4; - - + deny all; } - location = /lmstatus { - fastcgi_pass __PSGISERVERSOCKET__; - } + # Uncomment this if status is enabled + #location = /lmstatus { + # allow 127.0.0.1; + # deny all; + # include /etc/nginx/fastcgi_params; + # fastcgi_pass __PSGISERVERSOCKET__; + #} } diff --git a/e2e-tests/apache2.conf b/e2e-tests/apache2.conf index cbf9855b4..5081a02b3 100644 --- a/e2e-tests/apache2.conf +++ b/e2e-tests/apache2.conf @@ -35,6 +35,7 @@ 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 +PerlPassEnv LLNG_DEFAULTCONFFILE Include conf/env.conf AddHandler fcgid-script .fcgi LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so @@ -53,5 +54,6 @@ AddLanguage fr .fr MaxConnectionsPerChild 0 -IncludeOptional conf/manager-apache2.X.conf -IncludeOptional conf/portal-apache2.X.conf +Include conf/manager-apache2.X.conf +Include conf/portal-apache2.X.conf +Include conf/test-apache2.X.conf diff --git a/e2e-tests/llng.psgi b/e2e-tests/llng.psgi index 14fbc858f..08cb644df 100644 --- a/e2e-tests/llng.psgi +++ b/e2e-tests/llng.psgi @@ -30,10 +30,19 @@ my %builder = ( require CGI::Compile; return CGI::Emulate::PSGI->handler( CGI::Compile->compile('lemonldap-ng-portal/example/index.pl') ); - } + }, + test => sub { + require CGI::Emulate::PSGI; + require CGI::Compile; + return CGI::Emulate::PSGI->handler( + CGI::Compile->compile('e2e-tests/conf/site/index.pl') ); + }, ); sub { + if($_[0]->{HOST} =~ /^test/) { + $type = 'test'; + } my $type = $_[0]->{LLTYPE} || 'handler'; return $_apps{$type}->(@_) if ( defined $_apps{$type} ); if ( defined $builder{$type} ) {