Fix unit tests (#2276)

Moo
Christophe Maudoux 5 years ago
parent 53534e066d
commit 317172c8ac
  1. 7
      lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/BruteForceProtection.pm
  2. 1
      lemonldap-ng-portal/t/61-BruteForceProtection-with-Incremental-lockTimes-and-TOTP.t
  3. 4
      lemonldap-ng-portal/t/61-BruteForceProtection-with-Incremental-lockTimes.t

@ -71,11 +71,10 @@ sub init {
}
unless ( $lockTimes < $self->conf->{failedLoginNumber} ) {
$self->logger->warn(
'Number of incremental lock time values plus allowed failed logins attempt('
. "$lockTimes) is higher than failed logins history ("
$self->logger->warn( 'Number failed logins history ('
. $self->conf->{failedLoginNumber}
. ')' );
. ') must be higher than incremental lock time values plus allowed failed logins attempt ('
. "$lockTimes)" );
splice @{ $self->lockTimes }, $self->conf->{failedLoginNumber};
$lockTimes = $self->conf->{failedLoginNumber};
}

@ -26,6 +26,7 @@ SKIP: {
totp2fSelfRegistration => 1,
totp2fActivation => 1,
failedLoginNumber => 4,
bruteForceProtectionMaxFailed => 0,
}
}
);

@ -10,13 +10,13 @@ my $res;
my $client = LLNG::Manager::Test->new( {
ini => {
logLevel => 'debug',
logLevel => 'error',
authentication => 'Demo',
userDB => 'Same',
loginHistoryEnabled => 1,
bruteForceProtection => 1,
bruteForceProtectionIncrementalTempo => 1,
failedLoginNumber => 5,
failedLoginNumber => 6,
bruteForceProtectionMaxLockTime => 300,
bruteForceProtectionLockTimes => '5 , 500, bad ,20, 10 ',
bruteForceProtectionMaxFailed => 2,

Loading…
Cancel
Save