Improve unit test (#1932)
This commit is contained in:
parent
dd66f37739
commit
7da4d0c773
@ -12,6 +12,7 @@ my $client = LLNG::Manager::Test->new( {
|
|||||||
ini => {
|
ini => {
|
||||||
logLevel => 'error',
|
logLevel => 'error',
|
||||||
useSafeJail => 1,
|
useSafeJail => 1,
|
||||||
|
securedCookie => 3,
|
||||||
authentication => 'Slave',
|
authentication => 'Slave',
|
||||||
userDB => 'Same',
|
userDB => 'Same',
|
||||||
slaveUserHeader => 'My-Test',
|
slaveUserHeader => 'My-Test',
|
||||||
@ -29,14 +30,13 @@ my $client = LLNG::Manager::Test->new( {
|
|||||||
ok(
|
ok(
|
||||||
$res = $client->_get(
|
$res = $client->_get(
|
||||||
'/',
|
'/',
|
||||||
{
|
ip => '127.0.0.1',
|
||||||
ip => '127.0.0.1',
|
custom => {
|
||||||
custom => {
|
HTTP_MY_TEST => 'dwho',
|
||||||
HTTP_MY_TEST => 'dwho',
|
HTTP_NAME => 'Dr Who',
|
||||||
HTTP_NAME => 'Dr Who',
|
HTTP_CHECK_SLAVE => 'Passwor',
|
||||||
HTTP_CHECK_SLAVE => 'Passwor',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
),
|
),
|
||||||
'Auth query'
|
'Auth query'
|
||||||
);
|
);
|
||||||
@ -51,7 +51,6 @@ count(4);
|
|||||||
ok(
|
ok(
|
||||||
$res = $client->_get(
|
$res = $client->_get(
|
||||||
'/',
|
'/',
|
||||||
|
|
||||||
ip => '127.0.0.2',
|
ip => '127.0.0.2',
|
||||||
custom => {
|
custom => {
|
||||||
HTTP_MY_TEST => 'dwho',
|
HTTP_MY_TEST => 'dwho',
|
||||||
@ -73,7 +72,6 @@ count(4);
|
|||||||
ok(
|
ok(
|
||||||
$res = $client->_get(
|
$res = $client->_get(
|
||||||
'/',
|
'/',
|
||||||
|
|
||||||
ip => '127.0.0.1',
|
ip => '127.0.0.1',
|
||||||
custom => {
|
custom => {
|
||||||
HTTP_MY_TES => 'dwho',
|
HTTP_MY_TES => 'dwho',
|
||||||
@ -95,7 +93,6 @@ count(4);
|
|||||||
ok(
|
ok(
|
||||||
$res = $client->_get(
|
$res = $client->_get(
|
||||||
'/',
|
'/',
|
||||||
|
|
||||||
ip => '127.0.0.1',
|
ip => '127.0.0.1',
|
||||||
custom => {
|
custom => {
|
||||||
HTTP_MY_TEST => 'dwho',
|
HTTP_MY_TEST => 'dwho',
|
||||||
@ -108,7 +105,17 @@ ok(
|
|||||||
);
|
);
|
||||||
count(1);
|
count(1);
|
||||||
expectOK($res);
|
expectOK($res);
|
||||||
my $id = expectCookie($res);
|
|
||||||
|
my $id = expectCookie($res);
|
||||||
|
my $id_http = expectCookie( $res, 'lemonldaphttp' );
|
||||||
|
ok( $json = eval { from_json( $res->[2]->[0] ) }, 'Response is JSON' )
|
||||||
|
or print STDERR "$@\n" . Dumper($res);
|
||||||
|
ok( $json->{id} eq "$id", 'Session id found' )
|
||||||
|
or explain( $json, "id => session_id" );
|
||||||
|
ok( $json->{id_http} eq "$id_http", 'httpSession id found' )
|
||||||
|
or explain( $json, "id_http => http_session_id" );
|
||||||
|
count(3);
|
||||||
|
|
||||||
clean_sessions();
|
clean_sessions();
|
||||||
|
|
||||||
done_testing( count() );
|
done_testing( count() );
|
||||||
|
Loading…
Reference in New Issue
Block a user