From 240617d8d824f333497cc7f1f2ec36daa1ef64a5 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 6 Jul 2019 23:27:45 +0200 Subject: [PATCH] Fix unit tests --- .../Lemonldap/NG/Manager/Build/Attributes.pm | 2 +- .../NG/Portal/Plugins/ContextSwitching.pm | 2 +- .../t/59-Double-cookies-Refresh-and-Logout.t | 23 ++++++++++--------- .../t/68-Impersonation-with-doubleCookies.t | 1 + lemonldap-ng-portal/t/68-Impersonation.t | 1 + 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm index da8becdd2..aa6ed113a 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build/Attributes.pm @@ -435,7 +435,7 @@ sub attributes { }, checkUserHiddenAttributes => { type => 'text', - default => '_loginHistory hGroups _session_id', + default => '_loginHistory _session_id hGroups', documentation => 'Attributes to hide in CheckUser plugin', flags => 'p', }, diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm index 9d2cbeba1..2c197dc24 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/ContextSwitching.pm @@ -74,7 +74,7 @@ sub display { my $realSession; unless ( $realSession = $self->p->getApacheSession($realSessionId) ) { $self->userLogger->info( - "ContextSwitching: real session expired"); + "ContextSwitching: session $realSessionId expired"); return $self->p->do( $req, [ sub { PE_SESSIONEXPIRED } ] ); } diff --git a/lemonldap-ng-portal/t/59-Double-cookies-Refresh-and-Logout.t b/lemonldap-ng-portal/t/59-Double-cookies-Refresh-and-Logout.t index d7fb05a83..67ad6bf0b 100644 --- a/lemonldap-ng-portal/t/59-Double-cookies-Refresh-and-Logout.t +++ b/lemonldap-ng-portal/t/59-Double-cookies-Refresh-and-Logout.t @@ -9,17 +9,18 @@ BEGIN { my $res; my $client = LLNG::Manager::Test->new( { ini => { - logLevel => 'error', - authentication => 'Demo', - userDB => 'Same', - loginHistoryEnabled => 0, - brutForceProtection => 0, - portalMainLogo => 'common/logos/logo_llng_old.png', - requireToken => 0, - securedCookie => 2, - https => 0, - checkUser => 1, - handlerInternalCache => 0, + logLevel => 'error', + authentication => 'Demo', + userDB => 'Same', + loginHistoryEnabled => 0, + brutForceProtection => 0, + portalMainLogo => 'common/logos/logo_llng_old.png', + requireToken => 0, + securedCookie => 2, + https => 0, + checkUser => 1, + handlerInternalCache => 0, + checkUserHiddenAttributes => '_loginHistory hGroups', } } ); diff --git a/lemonldap-ng-portal/t/68-Impersonation-with-doubleCookies.t b/lemonldap-ng-portal/t/68-Impersonation-with-doubleCookies.t index 377ca139f..dc8e06c9c 100644 --- a/lemonldap-ng-portal/t/68-Impersonation-with-doubleCookies.t +++ b/lemonldap-ng-portal/t/68-Impersonation-with-doubleCookies.t @@ -26,6 +26,7 @@ my $client = LLNG::Manager::Test->new( { checkUserDisplayPersistentInfo => 0, checkUserDisplayEmptyValues => 0, impersonationMergeSSOgroups => 0, + checkUserHiddenAttributes => '_loginHistory hGroups', macros => { test_impersonation => '"$testPrefix__user/$_user"', _whatToTrace => diff --git a/lemonldap-ng-portal/t/68-Impersonation.t b/lemonldap-ng-portal/t/68-Impersonation.t index 3c6d10514..5866cdf00 100644 --- a/lemonldap-ng-portal/t/68-Impersonation.t +++ b/lemonldap-ng-portal/t/68-Impersonation.t @@ -26,6 +26,7 @@ my $client = LLNG::Manager::Test->new( { checkUserDisplayPersistentInfo => 0, checkUserDisplayEmptyValues => 0, impersonationMergeSSOgroups => 0, + checkUserHiddenAttributes => '_loginHistory hGroups', macros => { test_impersonation => '"$testPrefix__user/$_user"', _whatToTrace =>