Fix unit tests (#2589)

This commit is contained in:
Christophe Maudoux 2021-08-12 21:06:39 +02:00
parent b59ba39e05
commit 30fd065134
12 changed files with 57 additions and 50 deletions

View File

@ -23,7 +23,7 @@ my $client = LLNG::Manager::Test->new( {
findUser => 1,
impersonationRule => 1,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler' },
}
@ -54,7 +54,7 @@ ok(
);
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );
( $host, $url, $query ) =

View File

@ -24,7 +24,7 @@ my $client = LLNG::Manager::Test->new( {
findUser => 1,
impersonationRule => 1,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler' },
}

View File

@ -30,7 +30,8 @@ SKIP: {
combination => '[Demo, Demo] or [LDAP, LDAP]',
findUser => 1,
impersonationRule => 1,
findUserSearchingAttributes => { uid => 'Login', cn => 'Name' },
findUserSearchingAttributes =>
{ 'uid##1' => 'Login', 'cn##1' => 'Name' },
findUserExcludingAttributes => { uid => 'rtyler' },
}
}

View File

@ -58,10 +58,10 @@ SKIP: {
findUserWildcard => '#',
impersonationRule => 1,
findUserSearchingAttributes => {
uid => 'Login',
guy => 'Kind',
cn => 'Name',
room => 'Room'
'uid##1' => 'Login',
'guy##1' => 'Kind',
'cn##1' => 'Name',
'room##1' => 'Room'
},
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler # davrosjr # ' },
@ -91,7 +91,7 @@ SKIP: {
expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'room' );
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );

View File

@ -24,8 +24,11 @@ SKIP: {
captcha_login_enabled => 1,
findUser => 1,
impersonationRule => 1,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' }
findUserSearchingAttributes => {
'uid##1' => 'Login',
'guy##1' => 'Kind',
'cn##1' => 'Name'
}
}
}
);

View File

@ -21,8 +21,8 @@ my $client = LLNG::Manager::Test->new( {
findUserControl => '^[\w*\s]+$',
findUserWildcard => '*',
findUserSearchingAttributes => {
uid => 'Name',
guy => 'Kind',
'uid##1' => 'Name',
'guy##1' => 'Kind',
'type#Type#1' => 'mutant; mutant; character',
'cn#Name#0' => 'Bad Guy; Not a good person; The Daleks; daleks'
},
@ -52,7 +52,7 @@ ok(
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy' );
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );

View File

@ -17,7 +17,7 @@ my $client = LLNG::Manager::Test->new( {
findUser => 1,
impersonationRule => 1,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler' },
}

View File

@ -22,8 +22,8 @@ my $client = LLNG::Manager::Test->new( {
findUserControl => '^[\w*\s]+$',
findUserWildcard => '*',
findUserSearchingAttributes => {
uid => undef,
guy => 'Kind',
'uid#fdgd#1' => undef,
'guy##1' => 'Kind',
'cn#Name#1' => 'Bad Guy; Not a good person; BB; Bad Boy'
},
findUserExcludingAttributes =>
@ -52,7 +52,7 @@ ok(
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy' );
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );

View File

@ -37,8 +37,11 @@ SKIP: {
impersonationRule => 1,
findUserWildcard => '#',
findUserControl => '^[\w#\s]+$',
findUserSearchingAttributes =>
{ uid => 'Login', roomNumber => 'Room', cn => 'Name' },
findUserSearchingAttributes => {
'uid##1' => 'Login',
'roomNumber##1' => 'Room',
'cn##1' => 'Name'
},
findUserExcludingAttributes =>
{ mail => 'french@badwolf.org', uid => 'russian' },
}
@ -66,7 +69,7 @@ SKIP: {
expectForm( $res, '#', undef, 'uid', 'roomNumber', 'cn' );
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );

View File

@ -87,7 +87,7 @@ my $client = LLNG::Manager::Test->new( {
impersonationRule => 1,
useSafeJail => 1,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler' },
}

View File

@ -23,7 +23,7 @@ my $client = LLNG::Manager::Test->new( {
findUserControl => '^[\w*\s]+$',
findUserWildcard => '*',
findUserSearchingAttributes => {
uid => 'User',
'uid##1' => 'User',
},
authChoiceModules => {
strong => 'Apache;Demo;Null;;;{}',
@ -63,7 +63,7 @@ ok(
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid' );
ok(
$res->[2]->[0] =~
m%<input id="spoofIdfield" name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
m%<input name="spoofId" type="text" class="form-control" value="" autocomplete="off"%,
'value=""'
) or explain( $res->[2]->[0], 'value=""' );
ok(

View File

@ -19,7 +19,7 @@ my $client = LLNG::Manager::Test->new( {
findUser => 1,
impersonationRule => 0,
findUserSearchingAttributes =>
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
findUserExcludingAttributes =>
{ type => 'mutant', uid => 'rtyler' },
}