Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
c3ad2c39
Commit
c3ad2c39
authored
Dec 13, 2015
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update end-to-end tests: use own apache server
parent
8d1f3d27
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
126 additions
and
36 deletions
+126
-36
Makefile
Makefile
+42
-20
e2e-tests/apache2.conf
e2e-tests/apache2.conf
+57
-0
e2e-tests/e2e/00-auth.js
e2e-tests/e2e/00-auth.js
+2
-2
e2e-tests/e2e/99-logout.js
e2e-tests/e2e/99-logout.js
+2
-2
e2e-tests/e2e/README.md
e2e-tests/e2e/README.md
+1
-11
e2e-tests/manager-server.fcgi
e2e-tests/manager-server.fcgi
+21
-0
e2e-tests/protractor-conf.js
e2e-tests/protractor-conf.js
+1
-1
No files found.
Makefile
View file @
c3ad2c39
...
...
@@ -217,7 +217,24 @@ extra_test: all
# 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
:
protractor e2e-tests/protractor-conf.js
@
mkdir
-p
e2e-tests/conf
$(MAKE)
install_webserver_conf
\
RCONFDIR
=
e2e-tests/conf
\
ERASECONFIG
=
1
\
VHOSTLISTEN
=
'*:19876'
\
PORTALDIR
=
`
pwd
`
/lemonldap-ng-portal/example
\
MANAGERDIR
=
`
pwd
`
/lemonldap-ng-manager/site
\
MANAGERPSGIDIR
=
`
pwd
`
/e2e-tests
\
DEFDOCDIR
=
`
pwd
`
/doc
\
FRDOCDIR
=
`
pwd
`
/po-doc/fr
# Start web server
-
@[
-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
# Start e2e tests
@
protractor e2e-tests/protractor-conf.js
# Clean
@
kill
`
cat
e2e-tests/conf/apache2.pid
`
@
rm
-rf
e2e-tests/conf
#
# INSTALL
...
...
@@ -276,31 +293,13 @@ install_bin: install_conf_dir
#
# SITE INSTALL
#
install_site
:
install_manager_site install_portal_site install_handler_site install_test_site install_examples_site install_doc_site
install_site
:
install_manager_site install_portal_site install_handler_site install_test_site install_examples_site install_doc_site
install_webserver_conf
# Site install
@
install
-v
-d
$(RCONFDIR)
# Check if erase is wanted
@
if
[
"
$(ERASECONFIG)
"
-eq
"1"
]
;
then
\
cp
-f
_example/etc/portal-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/handler-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/manager-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/test-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/handler-nginx.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/test-nginx.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-access-control
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-http-accounting
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-fcgi-accounting
$(RCONFDIR)
;
\
cp
-f
_example/etc/for_etc_hosts
$(RCONFDIR)
;
\
fi
@
$(PERL)
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g; \
s#__PORTALDIR__#
$(PORTALDIR)
/#g; \
s#__MANAGERDIR__#
$(MANAGERDIR)
/#g; \
s#__MANAGERSTATICDIR__#
$(MANAGERSTATICDIR)
/#g; \
s#__MANAGERPSGIDIR__#
$(MANAGERPSGIDIR)
/#g; \
s#__TESTDIR__#
$(TESTDIR)
/#g; \
s#__VHOSTLISTEN__#
$(VHOSTLISTEN)
#g; \
s#__DEFDOCDIR__#
$(DEFDOCDIR)
/#g; \
s#__FRDOCDIR__#
$(FRDOCDIR)
/#g;'
$(RCONFDIR)
/
*
apache
*
.conf
$(RCONFDIR)
/
*
nginx
*
.conf
@
$(PERL)
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g'
$(RCONFDIR)
/for_etc_hosts
# Fix a lost of rights on the main directory
@
chmod
755
$(RBINDIR)
$(RDOCUMENTROOT)
$(REXAMPLESDIR)
$(RHANDLERDIR)
$(RPORTALSKINSDIR)
$(RMANAGERSITEDIR)
$(RTOOLSDIR)
$(RCONFDIR)
$(RDATADIR)
...
...
@@ -335,6 +334,29 @@ install_site: install_manager_site install_portal_site install_handler_site inst
fi
@
echo
install_webserver_conf
:
@
install
-m
755
-v
-d
$(RCONFDIR)
@
if
[
"
$(ERASECONFIG)
"
-eq
"1"
]
;
then
\
cp
-f
_example/etc/portal-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/handler-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/manager-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/test-apache
$(APACHEVERSION)
.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/handler-nginx.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/test-nginx.conf
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-access-control
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-http-accounting
$(RCONFDIR)
;
\
cp
-f
_example/etc/nginx-fcgi-accounting
$(RCONFDIR)
;
\
fi
@
$(PERL)
-i
-pe
's/__DNSDOMAIN__/
$(DNSDOMAIN)
/g; \
s#__PORTALDIR__#
$(PORTALDIR)
/#g; \
s#__MANAGERDIR__#
$(MANAGERDIR)
/#g; \
s#__MANAGERSTATICDIR__#
$(MANAGERSTATICDIR)
/#g; \
s#__MANAGERPSGIDIR__#
$(MANAGERPSGIDIR)
/#g; \
s#__TESTDIR__#
$(TESTDIR)
/#g; \
s#__VHOSTLISTEN__#
$(VHOSTLISTEN)
#g; \
s#__DEFDOCDIR__#
$(DEFDOCDIR)
/#g; \
s#__FRDOCDIR__#
$(FRDOCDIR)
/#g;'
$(RCONFDIR)
/
*
apache
*
.conf
$(RCONFDIR)
/
*
nginx
*
.conf
install_manager_site
:
install_conf_dir
# Manager install
@
install
-v
-d
${RMANAGERDIR}
$(RMANAGERSTATICDIR)
$(RMANAGERPSGIDIR)
\
...
...
e2e-tests/apache2.conf
0 → 100644
View file @
c3ad2c39
PidFile
conf
/
apache2
.
pid
Timeout
300
KeepAlive
On
MaxKeepAliveRequests
100
KeepAliveTimeout
5
HostnameLookups
Off
LogLevel
warn
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
</
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
ErrorLog
conf
/
apache2
.
log
CustomLog
conf
/
apache2
.
log
vhost_combined
LoadModule
alias_module
/
usr
/
lib
/
apache2
/
modules
/
mod_alias
.
so
LoadModule
dir_module
/
usr
/
lib
/
apache2
/
modules
/
mod_dir
.
so
LoadModule
env_module
/
usr
/
lib
/
apache2
/
modules
/
mod_env
.
so
LoadModule
mime_module
/
usr
/
lib
/
apache2
/
modules
/
mod_mime
.
so
LoadModule
fcgid_module
/
usr
/
lib
/
apache2
/
modules
/
mod_fcgid
.
so
FcgidConnectTimeout
20
FcgidProcessTableFile
conf
/
fcgid_shm
FcgidIPCDir
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
IncludeOptional
conf
/
manager
-
apache2
.
X
.
conf
IncludeOptional
conf
/
portal
-
apache2
.
X
.
conf
e2e-tests/e2e/00-auth.js
View file @
c3ad2c39
...
...
@@ -7,10 +7,10 @@ describe('my app', function() {
describe
(
'
Auth mechanism
'
,
function
()
{
it
(
'
should want to authenticate
'
,
function
()
{
browser
.
driver
.
get
(
'
http://auth.example.com/
'
);
browser
.
driver
.
get
(
'
http://auth.example.com
:19876
/
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='user']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//input[@name='password']
"
)).
sendKeys
(
'
dwho
'
);
browser
.
driver
.
findElement
(
by
.
xpath
(
"
//button[@type='submit']
"
)).
click
();
});
});
});
\ No newline at end of file
});
e2e-tests/e2e/99-logout.js
View file @
c3ad2c39
...
...
@@ -5,7 +5,7 @@
describe
(
'
Auth mechanism
'
,
function
()
{
it
(
'
should allow logout
'
,
function
()
{
browser
.
driver
.
get
(
'
http://auth.example.com/?logout=1
'
);
browser
.
driver
.
get
(
'
http://auth.example.com
:19876
/?logout=1
'
);
});
});
\ No newline at end of file
});
e2e-tests/e2e/README.md
View file @
c3ad2c39
#End 2 End Testing (Protractor)
To run the end-2-end tests against the application you use
[
Protractor
](
https://github.com/angular/protractor
)
.
## Starting the Web Server
In either case you will need the application to be running via the web-server.
From the root folder of the repository run:
```
npm start
```
The application should now be available at
`http://localhost:8000/`
## Testing with Protractor
As a one-time setup, download webdriver.
...
...
@@ -21,7 +11,7 @@ npm run update-webdriver
Start the Protractor test runner using the e2e configuration:
```
npm run protractor
make e2e_test
```
## Devel tips
...
...
e2e-tests/manager-server.fcgi
0 → 100755
View file @
c3ad2c39
#!/usr/bin/env perl
use
warnings
;
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";
}
;
die
$@
if
(
$@
);
}
use
Plack::Handler::
FCGI
;
use
Lemonldap::NG::
Manager
;
# Roll your own
my
$server
=
Plack::Handler::
FCGI
->
new
();
$server
->
run
(
Lemonldap::NG::
Manager
->
run
(
{}
)
);
e2e-tests/protractor-conf.js
View file @
c3ad2c39
...
...
@@ -11,7 +11,7 @@ exports.config = {
chromeOnly
:
true
,
baseUrl
:
'
http://manager.example.com/
'
,
baseUrl
:
'
http://manager.example.com
:19876
/
'
,
framework
:
'
jasmine
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment