Fix unit tests (#2589)
This commit is contained in:
parent
b59ba39e05
commit
30fd065134
|
@ -18,12 +18,12 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
'2_ssl' => 'SSL;Demo;Null',
|
'2_ssl' => 'SSL;Demo;Null',
|
||||||
},
|
},
|
||||||
authChoiceFindUser => '1_dem',
|
authChoiceFindUser => '1_dem',
|
||||||
useSafeJail => 1,
|
useSafeJail => 1,
|
||||||
requireToken => 1,
|
requireToken => 1,
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes =>
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
|
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler' },
|
{ type => 'mutant', uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
|
@ -53,12 +53,12 @@ ok(
|
||||||
'Post FindUser request'
|
'Post FindUser request'
|
||||||
);
|
);
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
( $host, $url, $query ) =
|
( $host, $url, $query ) =
|
||||||
expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'token' );
|
expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'token' );
|
||||||
$query =~ s/user=/user=rtyler/;
|
$query =~ s/user=/user=rtyler/;
|
||||||
$query =~ s/password=/password=rtyler/;
|
$query =~ s/password=/password=rtyler/;
|
||||||
$query =~ s/2_ssl/1_demo/;
|
$query =~ s/2_ssl/1_demo/;
|
||||||
|
|
|
@ -24,7 +24,7 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes =>
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
|
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler' },
|
{ type => 'mutant', uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ ok( $json = eval { from_json( $res->[2]->[0] ) }, 'Response is JSON' )
|
||||||
or print STDERR "$@\n" . Dumper($res);
|
or print STDERR "$@\n" . Dumper($res);
|
||||||
ok( $json->{user} eq 'dwho', ' Good user' )
|
ok( $json->{user} eq 'dwho', ' Good user' )
|
||||||
or explain( $json, 'user => dwho' );
|
or explain( $json, 'user => dwho' );
|
||||||
ok( $token = $json->{token}, 'Found token' );
|
ok( $token = $json->{token}, 'Found token' );
|
||||||
count(4);
|
count(4);
|
||||||
|
|
||||||
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Get Portal', );
|
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Get Portal', );
|
||||||
|
@ -79,7 +79,7 @@ ok( $json->{error} == 82, ' Token expired' )
|
||||||
or explain( $json, 'Token expired' );
|
or explain( $json, 'Token expired' );
|
||||||
ok( $json->{result} == 0, ' result => 0' )
|
ok( $json->{result} == 0, ' result => 0' )
|
||||||
or explain( $json, 'Result => 0' );
|
or explain( $json, 'Result => 0' );
|
||||||
ok( $token = $json->{token}, 'Found token' );
|
ok( $token = $json->{token}, 'Found token' );
|
||||||
count(6);
|
count(6);
|
||||||
|
|
||||||
clean_sessions();
|
clean_sessions();
|
||||||
|
|
|
@ -27,10 +27,11 @@ SKIP: {
|
||||||
'LDAP' => { 'for' => 0, 'type' => 'LDAP' },
|
'LDAP' => { 'for' => 0, 'type' => 'LDAP' },
|
||||||
'Demo' => { 'for' => 0, 'type' => 'Demo' }
|
'Demo' => { 'for' => 0, 'type' => 'Demo' }
|
||||||
},
|
},
|
||||||
combination => '[Demo, Demo] or [LDAP, LDAP]',
|
combination => '[Demo, Demo] or [LDAP, LDAP]',
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes => { uid => 'Login', cn => 'Name' },
|
findUserSearchingAttributes =>
|
||||||
|
{ 'uid##1' => 'Login', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes => { uid => 'rtyler' },
|
findUserExcludingAttributes => { uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,10 +58,10 @@ SKIP: {
|
||||||
findUserWildcard => '#',
|
findUserWildcard => '#',
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes => {
|
findUserSearchingAttributes => {
|
||||||
uid => 'Login',
|
'uid##1' => 'Login',
|
||||||
guy => 'Kind',
|
'guy##1' => 'Kind',
|
||||||
cn => 'Name',
|
'cn##1' => 'Name',
|
||||||
room => 'Room'
|
'room##1' => 'Room'
|
||||||
},
|
},
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler # davrosjr # ' },
|
{ type => 'mutant', uid => 'rtyler # davrosjr # ' },
|
||||||
|
@ -91,7 +91,7 @@ SKIP: {
|
||||||
expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'room' );
|
expectForm( $res, '#', undef, 'uid', 'guy', 'cn', 'room' );
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,18 @@ SKIP: {
|
||||||
}
|
}
|
||||||
my $client = LLNG::Manager::Test->new( {
|
my $client = LLNG::Manager::Test->new( {
|
||||||
ini => {
|
ini => {
|
||||||
logLevel => 'error',
|
logLevel => 'error',
|
||||||
authentication => 'Demo',
|
authentication => 'Demo',
|
||||||
userDB => 'Same',
|
userDB => 'Same',
|
||||||
useSafeJail => 1,
|
useSafeJail => 1,
|
||||||
captcha_login_enabled => 1,
|
captcha_login_enabled => 1,
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes => {
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' }
|
'uid##1' => 'Login',
|
||||||
|
'guy##1' => 'Kind',
|
||||||
|
'cn##1' => 'Name'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,8 +21,8 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUserControl => '^[\w*\s]+$',
|
findUserControl => '^[\w*\s]+$',
|
||||||
findUserWildcard => '*',
|
findUserWildcard => '*',
|
||||||
findUserSearchingAttributes => {
|
findUserSearchingAttributes => {
|
||||||
uid => 'Name',
|
'uid##1' => 'Name',
|
||||||
guy => 'Kind',
|
'guy##1' => 'Kind',
|
||||||
'type#Type#1' => 'mutant; mutant; character',
|
'type#Type#1' => 'mutant; mutant; character',
|
||||||
'cn#Name#0' => 'Bad Guy; Not a good person; The Daleks; daleks'
|
'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' );
|
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy' );
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes =>
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
|
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler' },
|
{ type => 'mutant', uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUserControl => '^[\w*\s]+$',
|
findUserControl => '^[\w*\s]+$',
|
||||||
findUserWildcard => '*',
|
findUserWildcard => '*',
|
||||||
findUserSearchingAttributes => {
|
findUserSearchingAttributes => {
|
||||||
uid => undef,
|
'uid#fdgd#1' => undef,
|
||||||
guy => 'Kind',
|
'guy##1' => 'Kind',
|
||||||
'cn#Name#1' => 'Bad Guy; Not a good person; BB; Bad Boy'
|
'cn#Name#1' => 'Bad Guy; Not a good person; BB; Bad Boy'
|
||||||
},
|
},
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
|
@ -52,7 +52,7 @@ ok(
|
||||||
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy' );
|
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid', 'guy' );
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,16 @@ SKIP: {
|
||||||
roomNumber => 'roomNumber',
|
roomNumber => 'roomNumber',
|
||||||
mail => 'mail'
|
mail => 'mail'
|
||||||
},
|
},
|
||||||
requireToken => 0,
|
requireToken => 0,
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
findUserWildcard => '#',
|
findUserWildcard => '#',
|
||||||
findUserControl => '^[\w#\s]+$',
|
findUserControl => '^[\w#\s]+$',
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes => {
|
||||||
{ uid => 'Login', roomNumber => 'Room', cn => 'Name' },
|
'uid##1' => 'Login',
|
||||||
|
'roomNumber##1' => 'Room',
|
||||||
|
'cn##1' => 'Name'
|
||||||
|
},
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ mail => 'french@badwolf.org', uid => 'russian' },
|
{ mail => 'french@badwolf.org', uid => 'russian' },
|
||||||
}
|
}
|
||||||
|
@ -66,7 +69,7 @@ SKIP: {
|
||||||
expectForm( $res, '#', undef, 'uid', 'roomNumber', 'cn' );
|
expectForm( $res, '#', undef, 'uid', 'roomNumber', 'cn' );
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
impersonationRule => 1,
|
impersonationRule => 1,
|
||||||
useSafeJail => 1,
|
useSafeJail => 1,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes =>
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
|
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler' },
|
{ type => 'mutant', uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUserControl => '^[\w*\s]+$',
|
findUserControl => '^[\w*\s]+$',
|
||||||
findUserWildcard => '*',
|
findUserWildcard => '*',
|
||||||
findUserSearchingAttributes => {
|
findUserSearchingAttributes => {
|
||||||
uid => 'User',
|
'uid##1' => 'User',
|
||||||
},
|
},
|
||||||
authChoiceModules => {
|
authChoiceModules => {
|
||||||
strong => 'Apache;Demo;Null;;;{}',
|
strong => 'Apache;Demo;Null;;;{}',
|
||||||
|
@ -63,7 +63,7 @@ ok(
|
||||||
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid' );
|
( $host, $url, $query ) = expectForm( $res, '#', undef, 'uid' );
|
||||||
ok(
|
ok(
|
||||||
$res->[2]->[0] =~
|
$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=""'
|
'value=""'
|
||||||
) or explain( $res->[2]->[0], 'value=""' );
|
) or explain( $res->[2]->[0], 'value=""' );
|
||||||
ok(
|
ok(
|
||||||
|
|
|
@ -19,7 +19,7 @@ my $client = LLNG::Manager::Test->new( {
|
||||||
findUser => 1,
|
findUser => 1,
|
||||||
impersonationRule => 0,
|
impersonationRule => 0,
|
||||||
findUserSearchingAttributes =>
|
findUserSearchingAttributes =>
|
||||||
{ uid => 'Login', guy => 'Kind', cn => 'Name' },
|
{ 'uid##1' => 'Login', 'guy##1' => 'Kind', 'cn##1' => 'Name' },
|
||||||
findUserExcludingAttributes =>
|
findUserExcludingAttributes =>
|
||||||
{ type => 'mutant', uid => 'rtyler' },
|
{ type => 'mutant', uid => 'rtyler' },
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user