Use old path for now (#595)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 9 years ago
parent 72a076d980
commit ef25e1f2ca
  1. 11
      lemonldap-ng-portal/t/01-AuthDemo.t
  2. 2
      lemonldap-ng-portal/t/test-lib.pm

@ -8,15 +8,20 @@ my $res;
init( { logLevel => 'debug', useSafeJail => 1 } ); init( { logLevel => 'debug', useSafeJail => 1 } );
# Test normal first access
# ------------------------
ok( $res = &client->_get('/'), 'Unauth JSON request' ); ok( $res = &client->_get('/'), 'Unauth JSON request' );
ok( $res->[0] == 401, 'Response is 401' ) or explain( $res, 401 ); ok( $res->[0] == 401, 'Response is 401' ) or explain( $res, 401 );
count(2); count(2);
# Test "first access" with good url
ok( $res = &client->_get('/?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tLw=='), ok( $res = &client->_get('/?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tLw=='),
'Unauth ajax request with good url' ); 'Unauth ajax request with good url' );
ok( $res->[0] == 401, 'Response is 401' ) or explain( $res, 401 ); ok( $res->[0] == 401, 'Response is 401' ) or explain( $res, 401 );
count(2); count(2);
# Try yo authenticate
# -------------------
ok( ok(
$res = &client->_post( $res = &client->_post(
'/', '', '/', '',
@ -25,12 +30,13 @@ ok(
), ),
'Auth query' 'Auth query'
); );
my $cookies = getCookies($res); my $cookies = getCookies($res);
my $id; my $id;
ok( $id = $cookies->{lemonldap}, 'Get cookie' ); ok( $id = $cookies->{lemonldap}, 'Get cookie' );
count(2); count(2);
# Try to get a redirection for an auth user with a valid url
# ----------------------------------------------------------
ok( ok(
$res = &client->_get( $res = &client->_get(
'/', '/',
@ -50,6 +56,9 @@ ok( $hdrs{'Lm-Remote-User'} eq 'dwho', 'User is set' )
or explain( \%hdrs, 'Lm-Remote-User => "dwho"' ); or explain( \%hdrs, 'Lm-Remote-User => "dwho"' );
count(4); count(4);
# Try to get a redirection for an auth user with a bad url (host undeclared
# in manager)
# -------------------------------------------------------------------------
ok( ok(
$res = &client->_get( $res = &client->_get(
'/', '/',

@ -19,7 +19,7 @@ sub init {
$ini->{configStorage} ||= { type => 'File', dirName => 't' }; $ini->{configStorage} ||= { type => 'File', dirName => 't' };
$ini->{logLevel} ||= 'error'; $ini->{logLevel} ||= 'error';
$ini->{cookieName} ||= 'lemonldap'; $ini->{cookieName} ||= 'lemonldap';
$ini->{templateDir} ||= 'site/templates'; $ini->{templateDir} ||= 'example/skins';
$ini->{staticPrefix} ||= '/index.fcgi'; $ini->{staticPrefix} ||= '/index.fcgi';
$ini->{securedCookie} //= 0; $ini->{securedCookie} //= 0;
$ini->{https} //= 0; $ini->{https} //= 0;

Loading…
Cancel
Save