Improve unit test (#1999)

This commit is contained in:
Christophe Maudoux 2020-04-18 19:01:56 +02:00
parent e00cb0ecf0
commit f7bedaf088
3 changed files with 7 additions and 6 deletions

View File

@ -19,7 +19,7 @@ my $client = LLNG::Manager::Test->new( {
requireToken => 0,
restSessionServer => 1,
globalLogoutRule => '$uid eq "dwho"',
globalLogoutCustomParam => 'authMode'
globalLogoutCustomParam => 'zeAUTHMODE_authmode'
}
}
);
@ -139,8 +139,8 @@ my ( $host, $url, $query ) =
ok( $res->[2]->[0] =~ m%<span trspan="globalLogout">%,
'Found trspan="globalLogout"' )
or explain( $res->[2]->[0], 'trspan="globalLogout"' );
ok( $res->[2]->[0] =~ m%<td scope="row">DEMO</td>%, 'CustomParam found "DEMO"' )
or explain( $res->[2]->[0], 'CustomParam DEMO' );
ok( $res->[2]->[0] =~ m%<td scope="row">DEMO_demo</td>%, 'Found CustomParam "DEMO_demo" macro' )
or explain( $res->[2]->[0], 'CustomParam "DEMO_demo" macro' );
my @c = ( $res->[2]->[0] =~ m%<td scope="row">127.0.0.1</td>%gs );
my @d = ( $res->[2]->[0] =~ m%<th scope="col">%gs );
my @e = ( $res->[2]->[0] =~ m%class="data-epoch">(\d{10})</td>%gs );

View File

@ -116,7 +116,7 @@ ok(
'POST checkuser'
);
my %attributes = map /<td scope="row">(.+)?<\/td>/g, $res->[2]->[0];
ok( scalar keys %attributes == 18, 'Found 18 attributes' )
ok( scalar keys %attributes == 19, 'Found 19 attributes' )
or print STDERR "Wrong number of attributes -> " . scalar keys %attributes;
ok( $attributes{'_updateTime'} =~ /^\d{14}$/, 'Timestamp found' )
or print STDERR Dumper( \%attributes );
@ -184,7 +184,7 @@ ok(
'POST checkuser'
);
my %attributes2 = map /<td scope="row">(.+)?<\/td>/g, $res->[2]->[0];
ok( scalar keys %attributes2 == 18, 'Found 18 attributes' )
ok( scalar keys %attributes2 == 19, 'Found 19 attributes' )
or print STDERR "Wrong nunber of attributes -> " . scalar keys %attributes2;
ok( $attributes2{'_updateTime'} =~ /^\d{14}$/, 'Timestamp found' )
or print STDERR Dumper( \%attributes2 );

View File

@ -96,7 +96,8 @@
"macros": {
"_whatToTrace": "$_auth eq 'SAML' ? \"$_user\\@$_idpConfKey\" : \"$_user\"",
"array": "$uid eq 'french' ? 'doctor; who' : ''",
"authMode": "$authenticationLevel == 8 ? TOTP : 'DEMO'"
"authMode": "$authenticationLevel == 8 ? 'TOTP' : 'DEMO'",
"zeAUTHMODE_authmode": "$authMode. '_' . lc $authMode"
},
"notifications": 0,
"passwordDB": "Null",