Update tests
This commit is contained in:
parent
d220b90198
commit
ce77b54114
39
Makefile
39
Makefile
|
@ -34,10 +34,8 @@ PORTALSKINSDIR=$(PORTALDIR)/skins
|
||||||
RPORTALSKINSDIR=$(DESTDIR)/$(PORTALSKINSDIR)
|
RPORTALSKINSDIR=$(DESTDIR)/$(PORTALSKINSDIR)
|
||||||
MANAGERDIR=$(DOCUMENTROOT)/manager
|
MANAGERDIR=$(DOCUMENTROOT)/manager
|
||||||
RMANAGERDIR=$(DESTDIR)/$(MANAGERDIR)
|
RMANAGERDIR=$(DESTDIR)/$(MANAGERDIR)
|
||||||
MANAGERSKINSDIR=$(MANAGERDIR)/skins
|
MANAGERSITEDIR=$(MANAGERDIR)/site
|
||||||
RMANAGERSKINSDIR=$(DESTDIR)/$(MANAGERSKINSDIR)
|
RMANAGERSITEDIR=$(DESTDIR)/$(MANAGERSITEDIR)
|
||||||
SESSIONSEXPLORERDIR=$(MANAGERDIR)
|
|
||||||
RSESSIONSEXPLORERDIR=$(DESTDIR)/$(SESSIONSEXPLORERDIR)
|
|
||||||
DOCDIR=$(DOCUMENTROOT)
|
DOCDIR=$(DOCUMENTROOT)
|
||||||
RDOCDIR=$(DESTDIR)/$(DOCDIR)
|
RDOCDIR=$(DESTDIR)/$(DOCDIR)
|
||||||
DEFDOCDIR=$(DOCUMENTROOT)/doc
|
DEFDOCDIR=$(DOCUMENTROOT)/doc
|
||||||
|
@ -102,7 +100,6 @@ VHOSTLISTEN=*:80
|
||||||
# Other
|
# Other
|
||||||
VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'`
|
VERSION=`head -n1 changelog |sed -e 's/lemonldap-ng (//' -e 's/).*$$//'`
|
||||||
PORTALSKINS=`ls lemonldap-ng-portal/example/skins/`
|
PORTALSKINS=`ls lemonldap-ng-portal/example/skins/`
|
||||||
MANAGERSKINS=`ls lemonldap-ng-manager/example/skins/`
|
|
||||||
DIFF=diff -aurN -x '*.bak' -x .svn -x '*.swp' --ignore-matching-lines='.*jquery.*' --ignore-matching-lines='.*lemonldap-ng\.ini.*'
|
DIFF=diff -aurN -x '*.bak' -x .svn -x '*.swp' --ignore-matching-lines='.*jquery.*' --ignore-matching-lines='.*lemonldap-ng\.ini.*'
|
||||||
|
|
||||||
SRCCOMMONDIR=lemonldap-ng-common
|
SRCCOMMONDIR=lemonldap-ng-common
|
||||||
|
@ -241,8 +238,8 @@ install_bin: install_conf_dir
|
||||||
${SRCPORTALDIR}/example/scripts/buildPortalWSDL \
|
${SRCPORTALDIR}/example/scripts/buildPortalWSDL \
|
||||||
${SRCCOMMONDIR}/scripts/convertConfig \
|
${SRCCOMMONDIR}/scripts/convertConfig \
|
||||||
${SRCCOMMONDIR}/scripts/lmMigrateConfFiles2ini \
|
${SRCCOMMONDIR}/scripts/lmMigrateConfFiles2ini \
|
||||||
${SRCMANAGERDIR}/example/scripts/lmConfigEditor \
|
${SRCMANAGERDIR}/scripts/lmConfigEditor \
|
||||||
${SRCMANAGERDIR}/example/scripts/lemonldap-ng-cli \
|
${SRCMANAGERDIR}/scripts/lemonldap-ng-cli \
|
||||||
$(RBINDIR)
|
$(RBINDIR)
|
||||||
@if [ ! "$(APACHEUSER)" ]; then \
|
@if [ ! "$(APACHEUSER)" ]; then \
|
||||||
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RBINDIR)/lmConfigEditor; \
|
$(PERL) -i -pe 's#__APACHEUSER__#nobody#g;' $(RBINDIR)/lmConfigEditor; \
|
||||||
|
@ -283,7 +280,7 @@ install_site: install_manager_site install_portal_site install_handler_site inst
|
||||||
s#__FRDOCDIR__#$(FRDOCDIR)/#g;' $(RCONFDIR)/*apache*.conf
|
s#__FRDOCDIR__#$(FRDOCDIR)/#g;' $(RCONFDIR)/*apache*.conf
|
||||||
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/for_etc_hosts
|
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/for_etc_hosts
|
||||||
# Fix a lost of rights on the main directory
|
# Fix a lost of rights on the main directory
|
||||||
@chmod 755 $(RBINDIR) $(RDOCUMENTROOT) $(REXAMPLESDIR) $(RHANDLERDIR) $(RPORTALSKINSDIR) $(RMANAGERSKINSDIR) $(RTOOLSDIR) $(RCONFDIR) $(RDATADIR)
|
@chmod 755 $(RBINDIR) $(RDOCUMENTROOT) $(REXAMPLESDIR) $(RHANDLERDIR) $(RPORTALSKINSDIR) $(RMANAGERSITEDIR) $(RTOOLSDIR) $(RCONFDIR) $(RDATADIR)
|
||||||
@echo
|
@echo
|
||||||
@echo "LemonLDAP::NG v${VERSION} is installed with these parameters:"
|
@echo "LemonLDAP::NG v${VERSION} is installed with these parameters:"
|
||||||
@echo " - System configuration: ${CONFDIR}"
|
@echo " - System configuration: ${CONFDIR}"
|
||||||
|
@ -317,28 +314,11 @@ install_site: install_manager_site install_portal_site install_handler_site inst
|
||||||
|
|
||||||
install_manager_site: install_conf_dir
|
install_manager_site: install_conf_dir
|
||||||
# Manager install
|
# Manager install
|
||||||
@install -v -d ${RMANAGERDIR} ${RMANAGERSKINSDIR} \
|
@install -v -d ${RMANAGERDIR} ${RMANAGERSITEDIR} \
|
||||||
${RSESSIONSEXPLORERDIR} \
|
$(RCONFDIR) ${RMANAGERDIR}
|
||||||
$(RCONFDIR) ${RMANAGERDIR}/skins/
|
|
||||||
@for skin in $$(ls lemonldap-ng-manager/example/skins/); do \
|
|
||||||
[ -h $(RMANAGERDIR)/skins/$$skin ] && rm -f $(RMANAGERDIR)/skins/$$skin; \
|
|
||||||
install -v -d $(RMANAGERSKINSDIR)/$$skin; \
|
|
||||||
done
|
|
||||||
@cp -pR -f ${SRCMANAGERDIR}/example/index.pl ${RMANAGERDIR}
|
|
||||||
@cp -pR -f ${SRCMANAGERDIR}/example/*.html ${RMANAGERDIR}
|
|
||||||
@cp -pR -f ${SRCMANAGERDIR}/example/skins/* $(RMANAGERSKINSDIR)
|
|
||||||
@if [ "$(MANAGERDIR)/skins/" != "$(MANAGERSKINSDIR)/" ]; then \
|
|
||||||
for skin in $$(ls lemonldap-ng-manager/example/skins/); do \
|
|
||||||
rm -rf $(RMANAGERDIR)/skins/$$skin/; \
|
|
||||||
ln -s $(MANAGERSKINSDIR)/$$skin $(RMANAGERDIR)/skins/$$skin; \
|
|
||||||
done; \
|
|
||||||
fi
|
|
||||||
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/$(CONFFILENAME)
|
@$(PERL) -i -pe 's/__DNSDOMAIN__/$(DNSDOMAIN)/g' $(RCONFDIR)/$(CONFFILENAME)
|
||||||
# Sessions explorer and notifications explorer install
|
# Sessions explorer and notifications explorer install
|
||||||
@cp -pR -f ${SRCMANAGERDIR}/example/sessions.pl $(RSESSIONSEXPLORERDIR)
|
@rm -rf $$(find ${RMANAGERDIR} ${RMANAGERSITEDIR} \
|
||||||
@cp -pR -f ${SRCMANAGERDIR}/example/notifications.pl $(RSESSIONSEXPLORERDIR)
|
|
||||||
@rm -rf $$(find ${RMANAGERDIR} ${RMANAGERSKINSDIR} \
|
|
||||||
${RSESSIONSEXPLORERDIR} \
|
|
||||||
$(RCONFDIR) -type d -name .svn)
|
$(RCONFDIR) -type d -name .svn)
|
||||||
|
|
||||||
install_portal_site: install_conf_dir
|
install_portal_site: install_conf_dir
|
||||||
|
@ -673,9 +653,6 @@ debian-diff:
|
||||||
@$(DIFF) lemonldap-ng-manager/example/notifications.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/notifications.pl ||true
|
@$(DIFF) lemonldap-ng-manager/example/notifications.pl $(DIFFPREFIX)/var/lib/lemonldap-ng/manager/notifications.pl ||true
|
||||||
@$(DIFF) --ignore-matching-lines='set.*get.*\[2\]' lemonldap-ng-manager/example/scripts/lmConfigEditor $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lmConfigEditor ||true
|
@$(DIFF) --ignore-matching-lines='set.*get.*\[2\]' lemonldap-ng-manager/example/scripts/lmConfigEditor $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lmConfigEditor ||true
|
||||||
@$(DIFF) --ignore-matching-lines='giveUpPrivileges' lemonldap-ng-manager/example/scripts/lemonldap-ng-cli $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lemonldap-ng-cli ||true
|
@$(DIFF) --ignore-matching-lines='giveUpPrivileges' lemonldap-ng-manager/example/scripts/lemonldap-ng-cli $(DIFFPREFIX)/usr/share/lemonldap-ng/bin/lemonldap-ng-cli ||true
|
||||||
@for i in $(MANAGERSKINS); do \
|
|
||||||
$(DIFF) -x 'jquery*' lemonldap-ng-manager/example/skins/$$i $(DIFFPREFIX)/usr/share/lemonldap-ng/manager-skins/$$i; \
|
|
||||||
done ||true
|
|
||||||
|
|
||||||
default-diff:
|
default-diff:
|
||||||
@# Portal
|
@# Portal
|
||||||
|
|
|
@ -86,7 +86,7 @@ sub getAll {
|
||||||
date => $1,
|
date => $1,
|
||||||
uid => $2,
|
uid => $2,
|
||||||
ref => decode_base64($3),
|
ref => decode_base64($3),
|
||||||
condition => decode_base64($4)
|
condition => decode_base64( $4 // '' )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
: ()
|
: ()
|
||||||
|
|
|
@ -77,7 +77,7 @@ sub genRoute {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub abort {
|
sub routerAbort {
|
||||||
my ( $self, $path, $msg ) = splice @_;
|
my ( $self, $path, $msg ) = splice @_;
|
||||||
delete $self->routes->{$path};
|
delete $self->routes->{$path};
|
||||||
$self->addRoute(
|
$self->addRoute(
|
||||||
|
|
|
@ -32,11 +32,6 @@ site-test/e2e/99-logout.js
|
||||||
site-test/e2e/README.md
|
site-test/e2e/README.md
|
||||||
site-test/protractor-conf.js
|
site-test/protractor-conf.js
|
||||||
site/psgi/manager-server.psgi
|
site/psgi/manager-server.psgi
|
||||||
site/static/authParams.html
|
|
||||||
site/static/blackWhiteList.html
|
|
||||||
site/static/bool.html
|
|
||||||
site/static/boolOrExpr.html
|
|
||||||
site/static/bootstrap.png
|
|
||||||
site/static/bwr/angular-ui-tree/dist/angular-ui-tree.min.css
|
site/static/bwr/angular-ui-tree/dist/angular-ui-tree.min.css
|
||||||
site/static/bwr/angular-ui-tree/dist/angular-ui-tree.min.js
|
site/static/bwr/angular-ui-tree/dist/angular-ui-tree.min.js
|
||||||
site/static/bwr/angular/angular.min.js
|
site/static/bwr/angular/angular.min.js
|
||||||
|
@ -48,17 +43,51 @@ site/static/bwr/bootstrap/dist/fonts/glyphicons-halflings-regular.woff
|
||||||
site/static/bwr/bootstrap/dist/js/bootstrap.min.js
|
site/static/bwr/bootstrap/dist/js/bootstrap.min.js
|
||||||
site/static/bwr/es5-shim/es5-shim.min.js
|
site/static/bwr/es5-shim/es5-shim.min.js
|
||||||
site/static/bwr/jquery/dist/jquery.min.js
|
site/static/bwr/jquery/dist/jquery.min.js
|
||||||
site/static/catAndAppList.html
|
site/static/css/manager.css
|
||||||
site/static/custom.png
|
site/static/forms/authParams.html
|
||||||
site/static/dark.png
|
site/static/forms/blackWhiteList.html
|
||||||
site/static/en.json
|
site/static/forms/bool.html
|
||||||
site/static/en.png
|
site/static/forms/boolOrExpr.html
|
||||||
site/static/file.html
|
site/static/forms/catAndAppList.html
|
||||||
site/static/fr.json
|
site/static/forms/file.html
|
||||||
site/static/fr.png
|
site/static/forms/home.html
|
||||||
site/static/home.html
|
site/static/forms/int.html
|
||||||
site/static/impact.png
|
site/static/forms/keyText.html
|
||||||
site/static/int.html
|
site/static/forms/keyTextContainer.html
|
||||||
|
site/static/forms/longtext.html
|
||||||
|
site/static/forms/menuApp.html
|
||||||
|
site/static/forms/menuCat.html
|
||||||
|
site/static/forms/oidcmetadatajson.html
|
||||||
|
site/static/forms/oidcmetadatajwks.html
|
||||||
|
site/static/forms/oidcOPMetaDataNode.html
|
||||||
|
site/static/forms/oidcOPMetaDataNodeContainer.html
|
||||||
|
site/static/forms/oidcRPMetaDataNode.html
|
||||||
|
site/static/forms/oidcRPMetaDataNodeContainer.html
|
||||||
|
site/static/forms/password.html
|
||||||
|
site/static/forms/portalskin.html
|
||||||
|
site/static/forms/post.html
|
||||||
|
site/static/forms/postContainer.html
|
||||||
|
site/static/forms/README.md
|
||||||
|
site/static/forms/restore.html
|
||||||
|
site/static/forms/RSAKey.html
|
||||||
|
site/static/forms/RSAKeyNoPassword.html
|
||||||
|
site/static/forms/rule.html
|
||||||
|
site/static/forms/ruleContainer.html
|
||||||
|
site/static/forms/samlAssertion.html
|
||||||
|
site/static/forms/samlAttribute.html
|
||||||
|
site/static/forms/samlAttributeContainer.html
|
||||||
|
site/static/forms/samlIDPMetaDataNode.html
|
||||||
|
site/static/forms/samlIDPMetaDataNodeContainer.html
|
||||||
|
site/static/forms/samlService.html
|
||||||
|
site/static/forms/samlSPMetaDataNode.html
|
||||||
|
site/static/forms/samlSPMetaDataNodeContainer.html
|
||||||
|
site/static/forms/select.html
|
||||||
|
site/static/forms/simpleInputContainer.html
|
||||||
|
site/static/forms/text.html
|
||||||
|
site/static/forms/trool.html
|
||||||
|
site/static/forms/virtualHost.html
|
||||||
|
site/static/forms/virtualHostContainer.html
|
||||||
|
site/static/forms/white.html
|
||||||
site/static/js/conftree.js
|
site/static/js/conftree.js
|
||||||
site/static/js/filterFunctions.js
|
site/static/js/filterFunctions.js
|
||||||
site/static/js/llApp.js
|
site/static/js/llApp.js
|
||||||
|
@ -66,49 +95,20 @@ site/static/js/manager.js
|
||||||
site/static/js/notifications.js
|
site/static/js/notifications.js
|
||||||
site/static/js/sessions.js
|
site/static/js/sessions.js
|
||||||
site/static/js/ui-bootstrap-tpls-0.12.1.min.js
|
site/static/js/ui-bootstrap-tpls-0.12.1.min.js
|
||||||
site/static/keyText.html
|
site/static/languages/en.json
|
||||||
site/static/keyTextContainer.html
|
site/static/languages/fr.json
|
||||||
site/static/llng-icon-32.png
|
site/static/logos/bootstrap.png
|
||||||
site/static/llng-icon-48.png
|
site/static/logos/custom.png
|
||||||
site/static/llng-icon.ico
|
site/static/logos/dark.png
|
||||||
site/static/llng.png
|
site/static/logos/en.png
|
||||||
site/static/longtext.html
|
site/static/logos/fr.png
|
||||||
site/static/manager.css
|
site/static/logos/impact.png
|
||||||
site/static/menuApp.html
|
site/static/logos/llng-icon-32.png
|
||||||
site/static/menuCat.html
|
site/static/logos/llng-icon-48.png
|
||||||
site/static/oidcmetadatajson.html
|
site/static/logos/llng-icon.ico
|
||||||
site/static/oidcmetadatajwks.html
|
site/static/logos/llng.png
|
||||||
site/static/oidcOPMetaDataNode.html
|
site/static/logos/pastel.png
|
||||||
site/static/oidcOPMetaDataNodeContainer.html
|
|
||||||
site/static/oidcRPMetaDataNode.html
|
|
||||||
site/static/oidcRPMetaDataNodeContainer.html
|
|
||||||
site/static/password.html
|
|
||||||
site/static/pastel.png
|
|
||||||
site/static/portalskin.html
|
|
||||||
site/static/post.html
|
|
||||||
site/static/postContainer.html
|
|
||||||
site/static/README.md
|
|
||||||
site/static/restore.html
|
|
||||||
site/static/RSAKey.html
|
|
||||||
site/static/RSAKeyNoPassword.html
|
|
||||||
site/static/rule.html
|
|
||||||
site/static/ruleContainer.html
|
|
||||||
site/static/samlAssertion.html
|
|
||||||
site/static/samlAttribute.html
|
|
||||||
site/static/samlAttributeContainer.html
|
|
||||||
site/static/samlIDPMetaDataNode.html
|
|
||||||
site/static/samlIDPMetaDataNodeContainer.html
|
|
||||||
site/static/samlService.html
|
|
||||||
site/static/samlSPMetaDataNode.html
|
|
||||||
site/static/samlSPMetaDataNodeContainer.html
|
|
||||||
site/static/select.html
|
|
||||||
site/static/simpleInputContainer.html
|
|
||||||
site/static/struct.json
|
site/static/struct.json
|
||||||
site/static/text.html
|
|
||||||
site/static/trool.html
|
|
||||||
site/static/virtualHost.html
|
|
||||||
site/static/virtualHostContainer.html
|
|
||||||
site/static/white.html
|
|
||||||
site/templates/footer.tpl
|
site/templates/footer.tpl
|
||||||
site/templates/header.tpl
|
site/templates/header.tpl
|
||||||
site/templates/manager.tpl
|
site/templates/manager.tpl
|
||||||
|
@ -117,20 +117,20 @@ site/templates/notifications.tpl
|
||||||
site/templates/scripts.tpl
|
site/templates/scripts.tpl
|
||||||
site/templates/sessions.tpl
|
site/templates/sessions.tpl
|
||||||
site/templates/tree.tpl
|
site/templates/tree.tpl
|
||||||
t/01-base-tree.json
|
|
||||||
t/02-base-tree-all-nodes-opened.json
|
|
||||||
t/02-HTML-template.t
|
t/02-HTML-template.t
|
||||||
t/03-HTML-forms.t
|
t/03-HTML-forms.t
|
||||||
t/05-rest-api.t
|
t/05-rest-api.t
|
||||||
t/06-rest-api.t
|
t/06-rest-api.t
|
||||||
t/10-save-unchanged-conf.t
|
t/10-save-unchanged-conf.t
|
||||||
t/12-modified.json
|
|
||||||
t/12-save-changed-conf.t
|
t/12-save-changed-conf.t
|
||||||
t/40-sessions.t
|
t/40-sessions.t
|
||||||
t/50-notifications.t
|
t/50-notifications.t
|
||||||
t/90-translations.t
|
t/90-translations.t
|
||||||
t/99-pod.t
|
t/99-pod.t
|
||||||
|
t/conf/lmConf-1.js
|
||||||
|
t/jsonfiles/01-base-tree.json
|
||||||
|
t/jsonfiles/02-base-tree-all-nodes-opened.json
|
||||||
|
t/jsonfiles/12-modified.json
|
||||||
t/lemonldap-ng.ini
|
t/lemonldap-ng.ini
|
||||||
t/lmConf-1.js
|
|
||||||
t/test-lib.pm
|
t/test-lib.pm
|
||||||
TODO.md
|
TODO.md
|
||||||
|
|
|
@ -41,7 +41,7 @@ sub init {
|
||||||
|
|
||||||
# TODO: manage errors
|
# TODO: manage errors
|
||||||
unless ( -r $self->{templateDir} ) {
|
unless ( -r $self->{templateDir} ) {
|
||||||
$self->error("Unable to read $self->{template}");
|
$self->error("Unable to read $self->{templateDir}");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ sub notifAccess {
|
||||||
|
|
||||||
# TODO: old parameters (with table)
|
# TODO: old parameters (with table)
|
||||||
unless ( $self->{notificationStorage} ) {
|
unless ( $self->{notificationStorage} ) {
|
||||||
$self->abort( notifications =>
|
$self->routerAbort( notifications =>
|
||||||
'notificationStorage is not defined in configuration' );
|
'notificationStorage is not defined in configuration' );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ sub notifAccess {
|
||||||
|
|
||||||
# If type not File or DBI, abort
|
# If type not File or DBI, abort
|
||||||
unless ( $args->{type} =~ /^(File|DBI|LDAP)$/ ) {
|
unless ( $args->{type} =~ /^(File|DBI|LDAP)$/ ) {
|
||||||
$self->abort( notifications =>
|
$self->routerAbort( notifications =>
|
||||||
"Only File, DBI or LDAP supported for Notifications" );
|
"Only File, DBI or LDAP supported for Notifications" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ sub notifAccess {
|
||||||
unless (
|
unless (
|
||||||
$self->_notifAccess( Lemonldap::NG::Common::Notification->new($args) ) )
|
$self->_notifAccess( Lemonldap::NG::Common::Notification->new($args) ) )
|
||||||
{
|
{
|
||||||
$self->abort(
|
$self->routerAbort(
|
||||||
notifications => $Lemonldap::NG::Common::Notification::msg );
|
notifications => $Lemonldap::NG::Common::Notification::msg );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@ use JSON;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
my $res;
|
my $res;
|
||||||
|
|
||||||
ok( $res = get('/'), 'Succeed to get /' );
|
ok( $res = get('/'), 'Succeed to get /' );
|
||||||
my %hdrs = @{ $res->[1] };
|
my %hdrs = @{ $res->[1] };
|
||||||
ok( $res->[0] == 200, 'Return a 200 code' );
|
ok( $res->[0] == 200, 'Return a 200 code' ) or print STDERR "Received".Dumper($res);
|
||||||
ok( $hdrs{'Content-Type'} =~ /text\/html$/i, 'Content is declared as HTML' );
|
ok( $hdrs{'Content-Type'} =~ /text\/html$/i, 'Content is declared as HTML' );
|
||||||
ok( $res->[2]->[0] =~ /<html/si, 'It contains a html tag' );
|
ok( $res->[2]->[0] =~ /<html/si, 'It contains a html tag' );
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ use Test::More;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
|
||||||
my $formDir = 'app/forms';
|
my $formDir = 'site/static/forms';
|
||||||
|
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
use_ok('Lemonldap::NG::Manager::Tree');
|
use_ok('Lemonldap::NG::Manager::Tree');
|
||||||
|
|
|
@ -5,8 +5,8 @@ use JSON;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
my $struct = 'app/struct.json';
|
my $struct = 'site/static/struct.json';
|
||||||
|
|
||||||
my @bad = qw(
|
my @bad = qw(
|
||||||
/conf/latest
|
/conf/latest
|
||||||
|
|
|
@ -5,7 +5,7 @@ use 5.10.0;
|
||||||
use strict;
|
use strict;
|
||||||
use JSON;
|
use JSON;
|
||||||
use IO::String;
|
use IO::String;
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
my $res;
|
my $res;
|
||||||
ok(
|
ok(
|
||||||
|
|
|
@ -5,12 +5,12 @@ use 5.10.0;
|
||||||
use strict;
|
use strict;
|
||||||
use JSON;
|
use JSON;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
my @struct =
|
my @struct =
|
||||||
qw[test/jsonfiles/01-base-tree.json test/jsonfiles/02-base-tree-all-nodes-opened.json];
|
qw[t/jsonfiles/01-base-tree.json t/jsonfiles/02-base-tree-all-nodes-opened.json];
|
||||||
my @desc = ( 'Unopened conf', 'Unchanged conf with all nodes opened' );
|
my @desc = ( 'Unopened conf', 'Unchanged conf with all nodes opened' );
|
||||||
my $confFiles = [ 'test/conf/lmConf-1.js', 'test/conf/lmConf-2.js' ];
|
my $confFiles = [ 't/conf/lmConf-1.js', 't/conf/lmConf-2.js' ];
|
||||||
|
|
||||||
sub body {
|
sub body {
|
||||||
return 0 unless (@struct);
|
return 0 unless (@struct);
|
||||||
|
|
|
@ -5,10 +5,10 @@ use 5.10.0;
|
||||||
use strict;
|
use strict;
|
||||||
use JSON;
|
use JSON;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
my $struct = 'test/jsonfiles/12-modified.json';
|
my $struct = 't/jsonfiles/12-modified.json';
|
||||||
my $confFiles = [ 'test/conf/lmConf-1.js', 'test/conf/lmConf-2.js' ];
|
my $confFiles = [ 't/conf/lmConf-1.js', 't/conf/lmConf-2.js' ];
|
||||||
|
|
||||||
sub body {
|
sub body {
|
||||||
return IO::File->new( $struct, 'r' );
|
return IO::File->new( $struct, 'r' );
|
||||||
|
|
|
@ -4,11 +4,10 @@ use Test::More;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
use Lemonldap::NG::Common::Session;
|
use Lemonldap::NG::Common::Session;
|
||||||
use Data::Dumper;
|
|
||||||
|
|
||||||
eval { mkdir 'test/sessions' };
|
eval { mkdir 't/sessions' };
|
||||||
`rm -rf test/sessions/*`;
|
`rm -rf t/sessions/*`;
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
sub newSession {
|
sub newSession {
|
||||||
my ( $uid, $ip ) = splice @_;
|
my ( $uid, $ip ) = splice @_;
|
||||||
|
@ -18,7 +17,7 @@ sub newSession {
|
||||||
{
|
{
|
||||||
storageModule => 'Apache::Session::File',
|
storageModule => 'Apache::Session::File',
|
||||||
storageModuleOptions => {
|
storageModuleOptions => {
|
||||||
Directory => 'test/sessions',
|
Directory => 't/sessions',
|
||||||
generateModule =>
|
generateModule =>
|
||||||
'Lemonldap::NG::Common::Apache::Session::Generate::SHA256',
|
'Lemonldap::NG::Common::Apache::Session::Generate::SHA256',
|
||||||
},
|
},
|
||||||
|
@ -151,7 +150,7 @@ foreach (@ids) {
|
||||||
count(3);
|
count(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
opendir D, 'test/sessions' or die 'Unknown dir';
|
opendir D, 't/sessions' or die 'Unknown dir';
|
||||||
my @files = grep { not /^\./ } readdir D;
|
my @files = grep { not /^\./ } readdir D;
|
||||||
ok( @files == 0, "Session directory is empty" );
|
ok( @files == 0, "Session directory is empty" );
|
||||||
count(1);
|
count(1);
|
||||||
|
|
|
@ -4,11 +4,10 @@ use Test::More;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
use IO::String;
|
use IO::String;
|
||||||
use Data::Dumper;
|
|
||||||
|
|
||||||
eval { mkdir 'test/notifications' };
|
eval { mkdir 't/notifications' };
|
||||||
`rm -rf test/notifications/*`;
|
`rm -rf t/notifications/*`;
|
||||||
require 'test/test-lib.pm';
|
require 't/test-lib.pm';
|
||||||
|
|
||||||
# Try to create a notification
|
# Try to create a notification
|
||||||
my $notif =
|
my $notif =
|
||||||
|
@ -50,7 +49,7 @@ count(2);
|
||||||
|
|
||||||
#print STDERR Dumper($res);
|
#print STDERR Dumper($res);
|
||||||
|
|
||||||
`rm -f test/notifications/*`;
|
`rm -f t/notifications/*`;
|
||||||
|
|
||||||
done_testing( count() );
|
done_testing( count() );
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use JSON;
|
||||||
use strict;
|
use strict;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
|
||||||
my $langDir = 'app/languages';
|
my $langDir = 'site/static/languages';
|
||||||
|
|
||||||
my $count = 0;
|
my $count = 0;
|
||||||
use_ok('Lemonldap::NG::Manager::Tree');
|
use_ok('Lemonldap::NG::Manager::Tree');
|
||||||
|
@ -86,7 +86,7 @@ $count += 2;
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
open( F,
|
open( F,
|
||||||
q#perl -ne 'print if(s/.*trspan="(\w+)".*/$1/g)' pl/manager.tpl app/forms/*|sort -u|#
|
q#perl -ne 'print if(s/.*trspan="(\w+)".*/$1/g)' site/templates/manager.tpl site/static/forms/*|sort -u|#
|
||||||
),
|
),
|
||||||
'Find HTML docs'
|
'Find HTML docs'
|
||||||
);
|
);
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
},
|
},
|
||||||
"globalStorage": "Apache::Session::File",
|
"globalStorage": "Apache::Session::File",
|
||||||
"globalStorageOptions": {
|
"globalStorageOptions": {
|
||||||
"Directory": "test/sessions",
|
"Directory": "t/sessions",
|
||||||
"generateModule": "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
|
"generateModule": "Lemonldap::NG::Common::Apache::Session::Generate::SHA256"
|
||||||
},
|
},
|
||||||
"groups": {},
|
"groups": {},
|
||||||
|
@ -134,7 +134,7 @@
|
||||||
"notification": 1,
|
"notification": 1,
|
||||||
"notificationStorage": "File",
|
"notificationStorage": "File",
|
||||||
"notificationStorageOptions": {
|
"notificationStorageOptions": {
|
||||||
"dirName": "test/notifications"
|
"dirName": "t/notifications"
|
||||||
},
|
},
|
||||||
"passwordDB": "Demo",
|
"passwordDB": "Demo",
|
||||||
"persistentStorage": "Apache::Session::File",
|
"persistentStorage": "Apache::Session::File",
|
||||||
|
@ -150,4 +150,4 @@
|
||||||
"timeout": 72000,
|
"timeout": 72000,
|
||||||
"userDB": "Demo",
|
"userDB": "Demo",
|
||||||
"whatToTrace": "_whatToTrace"
|
"whatToTrace": "_whatToTrace"
|
||||||
}
|
}
|
|
@ -1158,7 +1158,7 @@
|
||||||
}, {
|
}, {
|
||||||
"cnodes": "globalStorageOptions",
|
"cnodes": "globalStorageOptions",
|
||||||
"default": [{
|
"default": [{
|
||||||
"data": "test/sessions",
|
"data": "t/sessions",
|
||||||
"id": "globalStorageOptions/Directory",
|
"id": "globalStorageOptions/Directory",
|
||||||
"title": "Directory",
|
"title": "Directory",
|
||||||
"type": "keyText"
|
"type": "keyText"
|
|
@ -1314,7 +1314,7 @@
|
||||||
"data": "Apache::Session::File"
|
"data": "Apache::Session::File"
|
||||||
}, {
|
}, {
|
||||||
"default": [{
|
"default": [{
|
||||||
"data": "test/sessions",
|
"data": "t/sessions",
|
||||||
"id": "globalStorageOptions/Directory",
|
"id": "globalStorageOptions/Directory",
|
||||||
"title": "Directory",
|
"title": "Directory",
|
||||||
"type": "keyText"
|
"type": "keyText"
|
||||||
|
@ -1333,7 +1333,7 @@
|
||||||
"title": "globalStorageOptions",
|
"title": "globalStorageOptions",
|
||||||
"type": "keyTextContainer",
|
"type": "keyTextContainer",
|
||||||
"nodes": [{
|
"nodes": [{
|
||||||
"data": "test/sessions",
|
"data": "t/sessions",
|
||||||
"title": "Directory",
|
"title": "Directory",
|
||||||
"type": "keyText",
|
"type": "keyText",
|
||||||
"id": "globalStorageOptions/Directory"
|
"id": "globalStorageOptions/Directory"
|
||||||
|
@ -1525,7 +1525,7 @@
|
||||||
"title": "dirName",
|
"title": "dirName",
|
||||||
"type": "keyText",
|
"type": "keyText",
|
||||||
"id": "notificationStorageOptions/dirName",
|
"id": "notificationStorageOptions/dirName",
|
||||||
"data": "test/notifications"
|
"data": "t/notifications"
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"default": "allusers",
|
"default": "allusers",
|
|
@ -1344,7 +1344,7 @@
|
||||||
"title": "globalStorageOptions",
|
"title": "globalStorageOptions",
|
||||||
"type": "keyTextContainer",
|
"type": "keyTextContainer",
|
||||||
"nodes": [{
|
"nodes": [{
|
||||||
"data": "test/sessions",
|
"data": "t/sessions",
|
||||||
"title": "Directory",
|
"title": "Directory",
|
||||||
"type": "keyText",
|
"type": "keyText",
|
||||||
"id": "globalStorageOptions/Directory"
|
"id": "globalStorageOptions/Directory"
|
||||||
|
@ -1536,7 +1536,7 @@
|
||||||
"title": "dirName",
|
"title": "dirName",
|
||||||
"type": "keyText",
|
"type": "keyText",
|
||||||
"id": "notificationStorageOptions/dirName",
|
"id": "notificationStorageOptions/dirName",
|
||||||
"data": "test/notifications"
|
"data": "t/notifications"
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
"default": "allusers",
|
"default": "allusers",
|
|
@ -3,7 +3,7 @@
|
||||||
[configuration]
|
[configuration]
|
||||||
|
|
||||||
type=File
|
type=File
|
||||||
dirName=test/conf
|
dirName=t/conf
|
||||||
|
|
||||||
[portal]
|
[portal]
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ protection = manager
|
||||||
logLevel = error
|
logLevel = error
|
||||||
staticPrefix = app/
|
staticPrefix = app/
|
||||||
languages = fr, en
|
languages = fr, en
|
||||||
templateDir = pl/
|
templateDir = site/templates/
|
||||||
|
|
||||||
[sessionsExplorer]
|
[sessionsExplorer]
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use JSON;
|
use JSON;
|
||||||
use 5.10.0;
|
use 5.10.0;
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
use_ok('Lemonldap::NG::Manager');
|
use_ok('Lemonldap::NG::Manager');
|
||||||
|
|
||||||
|
@ -10,14 +11,16 @@ my $app;
|
||||||
ok(
|
ok(
|
||||||
$app = Lemonldap::NG::Manager->run(
|
$app = Lemonldap::NG::Manager->run(
|
||||||
{
|
{
|
||||||
configStorage => { confFile => 'test/lemonldap-ng.ini' },
|
configStorage => { confFile => 't/lemonldap-ng.ini' },
|
||||||
protection => 'none',
|
protection => 'none',
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
'New app'
|
'New app'
|
||||||
);
|
);
|
||||||
|
|
||||||
our $count = 2;
|
ok( ref($app) eq 'CODE', 'app is a subroutine' );
|
||||||
|
|
||||||
|
our $count = 3;
|
||||||
|
|
||||||
sub count {
|
sub count {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
|
@ -149,8 +152,10 @@ sub jsonResponse {
|
||||||
sub jsonPostResponse {
|
sub jsonPostResponse {
|
||||||
my ( $path, $query, $body, $type, $len ) = splice @_;
|
my ( $path, $query, $body, $type, $len ) = splice @_;
|
||||||
my $res;
|
my $res;
|
||||||
ok( $res = post( $path, $query, $body, $type, $len ),
|
ok(
|
||||||
"Succeed to post to $path" . ( $query ? "?$query" : "" ) );
|
$res = post( $path, $query, $body, $type, $len ),
|
||||||
|
"Succeed to post to $path" . ( $query ? "?$query" : "" )
|
||||||
|
);
|
||||||
ok( $res->[0] == 200, "Return code eq 200" ) or print STDERR Dumper($res);
|
ok( $res->[0] == 200, "Return code eq 200" ) or print STDERR Dumper($res);
|
||||||
my $href;
|
my $href;
|
||||||
ok( $href = decode_json( $res->[2]->[0] ), 'Response is JSON' );
|
ok( $href = decode_json( $res->[2]->[0] ), 'Response is JSON' );
|
||||||
|
@ -161,8 +166,10 @@ sub jsonPostResponse {
|
||||||
sub jsonPutResponse {
|
sub jsonPutResponse {
|
||||||
my ( $path, $query, $body, $type, $len ) = splice @_;
|
my ( $path, $query, $body, $type, $len ) = splice @_;
|
||||||
my $res;
|
my $res;
|
||||||
ok( $res = put( $path, $query, $body, $type, $len ),
|
ok(
|
||||||
"Succeed to post to $path" . ( $query ? "?$query" : "" ) );
|
$res = put( $path, $query, $body, $type, $len ),
|
||||||
|
"Succeed to post to $path" . ( $query ? "?$query" : "" )
|
||||||
|
);
|
||||||
ok( $res->[0] == 200, "Return code eq 200" ) or print STDERR Dumper($res);
|
ok( $res->[0] == 200, "Return code eq 200" ) or print STDERR Dumper($res);
|
||||||
my $href;
|
my $href;
|
||||||
ok( $href = decode_json( $res->[2]->[0] ), 'Response is JSON' );
|
ok( $href = decode_json( $res->[2]->[0] ), 'Response is JSON' );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user