Commit d59e8505 authored by Eric German's avatar Eric German

completion of initial depot

parent 24d75a9a
......@@ -5,4 +5,8 @@ Revision history for Perl extension Lemonldap::Config::Parameters.
-XAn Lemonldap::Config::Parameters
3.0.0 Thu Jun 29 15:08:00 2006
- bigbang in parameters
3.1.0 Wed Oct 25 15:08:00 2006
- add new parameters
- giving up compatibility with old modperl API.
NAME
Lemonldap::Config::Parameters - Backend of configuration for lemonldap
web-SSO system
Lemonldap::Config::Parameters - Backend of configuration for lemonldap
web SSO system
SYNOPSIS
#!/usr/bin/perl
......@@ -34,7 +34,7 @@ INSTALLATION
make install
DESCRIPTION
Lemonldap is a WEBSSO framework system under GPL.
Lemonldap is a WEB SSO framework system under GPL.
Login page , handlers must retrieve their configs in an unique file eg
:"applications.xml".
......
#!/usr/bin/perl -w
use strict;
use Lemonldap::Config::Parameters;
my $key=shift||'/tmp/CONF';
Lemonldap::Config::Parameters::f_dump($key);
#!/usr/bin/perl -w
use strict;
use XML::Simple;
my $file = shift;
my $test;
eval {
$test = XMLin( $file,
);
} ;
if ($@) { print "ERREUR SUR $file\n";
} else {
print "$file:Correct\n";
}
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
BEGIN { use_ok('Lemonldap::Config::Parameters') };
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
#====================================================================
# Test script for Lemonldap::Config::Parameters
#
# 2005 (c) Clement OUDOT (LINAGORA)
#====================================================================
#====================================================================
# Perl test modules
#====================================================================
use Test::More tests => 12;
#====================================================================
# Module loading
#====================================================================
BEGIN{ use_ok( Lemonldap::Config::Parameters ); }
BEGIN{ print "--> Version : ".$Lemonldap::Config::Parameters::VERSION."\n"; }
#====================================================================
# Object creation
#====================================================================
my $file = "t/test.xml";
my $config = Lemonldap::Config::Parameters->new( file => $file, cache => '/tmp/TEST' );
my $config_nocache = Lemonldap::Config::Parameters->new( file => $file );
isa_ok( $config, Lemonldap::Config::Parameters );
isa_ok( $config_nocache, Lemonldap::Config::Parameters );
#====================================================================
# Methods
#====================================================================
my @methods = (
'_getFromCache',
'destroy',
'f_delete',
'f_reload',
'f_dump',
'_readFile',
'_deleteCache',
'_writeCache',
'getDomain',
'findParagraph',
'formateLineHash',
'formateLineArray',
'getAllConfig',
);
can_ok( $config, @methods );
can_ok( $config_nocache, @methods );
#====================================================================
# Domain
#====================================================================
my $domain = "foo.com";
my $domain_cache = $config->getDomain( $domain );
my $domain_nocache = $config_nocache->getDomain( $domain );
ok( $domain_cache, "getDomain on $domain with cache" );
ok( $domain_nocache, "getDomain on $domain without cache" );
is_deeply( $domain_cache, $domain_nocache, "Equality of the domain (with an without cache)" );
#====================================================================
# Session
#====================================================================
my $session = $domain_cache->{'Session'};
ok( $session, "Read session value in domain paragraph" );
my $session_cache = $config->findParagraph( 'session', $session );
my $session_nocache = $config_nocache->findParagraph( 'session', $session );
ok( $session_cache, "findParagraph session on $session with cache" );
ok( $session_nocache, "findParagraph session on $session without cache" );
is_deeply( $session_cache, $session_nocache, "Equality of the session (with an without cache)" );
<lemonconfig>
<domain
id="foo.com"
Cookie="Brownie"
Portal="https://www.foo.com/portail/accueil.pl"
Menu="https://www.foo.com/portail/menu.pl"
Session="memcached"
ldap_server="ldap.foo.com"
ldap_branch_people="ou=people,dc=foo,dc=com"
DnManager="uid=root,dc=foo,dc=com"
PasswordManager="secret"
>
<handler
id="LINAGORA"
AttrLdap="LINUX"
CodeAppli="TUX"
BasePub="http://public.foo.com"
BasePriv="http://private.foo.com"
IpcNb="5"
Enabledproxy="1"
ProxyExt="http://10.75.5.12:3132"
>
</handler>
</domain>
<cache id="/tmp/TEST">
</cache>
<session id="memcached" SessionParams="(servers => ['127.0.0.1:11211'])">
</session>
</lemonconfig>
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