Commit 09996f98 authored by Christophe Maudoux's avatar Christophe Maudoux

Improve unit test (#1667)

parent cc047402
......@@ -49,6 +49,22 @@ ok( $res->[2]->[0] =~ m%"PE85":"From lemonlap-ng.ini"%,
count(9);
# Try yo authenticate
# -------------------
ok(
$res = $client->_post(
'/',
IO::String->new('user=dwho*&password=dwho'),
accept => 'text/html',
length => 24
),
'Auth query'
);
ok( $res->[2]->[0] =~ m%<span trmsg="40"></span>%,
' PE40 found' )
or print STDERR Dumper( $res->[2]->[0] );
count(2);
# Try yo authenticate
# -------------------
ok(
......
......@@ -26,6 +26,31 @@ my $client = LLNG::Manager::Test->new(
}
);
## Try to authenticate with bad spoofed user
ok( $res = $client->_get( '/', accept => 'text/html' ),
'Get Menu', );
count(1);
my ( $host, $url, $query ) =
expectForm( $res, '#', undef, 'user', 'password', 'spoofId' );
$query =~ s/user=/user=rtyler/;
$query =~ s/password=/password=rtyler/;
$query =~ s/spoofId=/spoofId=dwho*/;
ok( $res = $client->_post(
'/',
IO::String->new($query),
length => length($query),
accept => 'text/html',
),
'Auth query'
);
ok( $res->[2]->[0] =~ m%<span trmsg="40"></span>%,
' PE40 found' )
or print STDERR Dumper( $res->[2]->[0] );
count(2);
my $id = expectCookie($res);
$client->logout($id);
## Try to authenticate
ok( $res = $client->_get( '/', accept => 'text/html' ),
......@@ -47,7 +72,7 @@ ok( $res = $client->_post(
);
count(1);
my $id = expectCookie($res);
$id = expectCookie($res);
expectRedirection( $res, 'http://auth.example.com/' );
# CheckUser form
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment