Fix test (#2501)
This commit is contained in:
parent
b67d11c58a
commit
6eda19c112
|
@ -4,15 +4,20 @@ use IO::String;
|
|||
use Data::Dumper;
|
||||
|
||||
require 't/test-lib.pm';
|
||||
require 't/smtp.pm';
|
||||
my $maintests = 5;
|
||||
|
||||
SKIP: {
|
||||
eval { require Crypt::U2F::Server; require Authen::U2F::Tester };
|
||||
if ( $@ or $Crypt::U2F::Server::VERSION < 0.42 ) {
|
||||
skip 'Missing libraries', $maintests;
|
||||
}
|
||||
|
||||
use_ok('Lemonldap::NG::Common::FormEncode');
|
||||
count(1);
|
||||
my $res;
|
||||
|
||||
my $client = LLNG::Manager::Test->new( {
|
||||
ini => {
|
||||
logLevel => 'debug',
|
||||
logLevel => 'error',
|
||||
sfOnlyUpgrade => 1,
|
||||
u2fActivation => 1,
|
||||
u2fAuthnLevel => 5,
|
||||
|
@ -39,14 +44,11 @@ ok(
|
|||
),
|
||||
'Auth query'
|
||||
);
|
||||
count(1);
|
||||
|
||||
my $id = expectCookie($res);
|
||||
|
||||
# After attempting to access test1,
|
||||
# the handler sends up back to /upgradesession
|
||||
# --------------------------------------------
|
||||
|
||||
ok(
|
||||
$res = $client->_get(
|
||||
'/upgradesession',
|
||||
|
@ -56,7 +58,6 @@ ok(
|
|||
),
|
||||
'Upgrade session query'
|
||||
);
|
||||
count(1);
|
||||
|
||||
( my $host, my $url, $query ) =
|
||||
expectForm( $res, undef, '/upgradesession', 'confirm', 'url' );
|
||||
|
@ -74,9 +75,8 @@ ok(
|
|||
),
|
||||
'Accept session upgrade query'
|
||||
);
|
||||
count(1);
|
||||
|
||||
my $pdata = expectCookie( $res, 'lemonldappdata' );
|
||||
expectCookie( $res, 'lemonldappdata' );
|
||||
|
||||
# A message warns the user that they do not have any 2FA available
|
||||
expectPortalError( $res, 83 );
|
||||
|
@ -92,8 +92,11 @@ ok(
|
|||
),
|
||||
'Accept session upgrade query'
|
||||
);
|
||||
count(1);
|
||||
expectRedirection( $res, 'http://auth.example.com/' );
|
||||
$client->logout($id);
|
||||
}
|
||||
|
||||
count($maintests);
|
||||
clean_sessions();
|
||||
|
||||
done_testing( count() );
|
||||
|
|
Loading…
Reference in New Issue
Block a user