Commit 0da228ff authored by Yadd's avatar Yadd
Browse files

make tidy

parent 585bf4a2
......@@ -26,7 +26,8 @@ my $client = LLNG::Manager::Test->new(
# Test redirection to remote portal
ok( $res = $client->_get( '/', accept => 'text/html' ), 'First request' );
count(1);
expectRedirection($res, 'http://auth2.example.com?url=aHR0cDovL2F1dGguZXhhbXBsZS5jb20v');
expectRedirection( $res,
'http://auth2.example.com?url=aHR0cDovL2F1dGguZXhhbXBsZS5jb20v' );
ok(
$res = $client->_get(
......
......@@ -49,10 +49,13 @@ SKIP: {
),
'Query IdP to access to SP'
);
my($url,$query) = expectRedirection($res,qr#http://auth.sp.com(/saml/proxySingleSignOnArtifact)\?(SAMLart=[^&]+)#);
switch('sp');
ok($res=$sp->_get($url,query=>$query,accept=>'test/html'),'Give artifact to SP');
expectRedirection($res,'http://auth.sp.com');
my ( $url, $query ) = expectRedirection( $res,
qr#http://auth.sp.com(/saml/proxySingleSignOnArtifact)\?(SAMLart=[^&]+)#
);
switch ('sp');
ok( $res = $sp->_get( $url, query => $query, accept => 'test/html' ),
'Give artifact to SP' );
expectRedirection( $res, 'http://auth.sp.com' );
my $spId = expectCookie($res);
# Verify authentication on SP
......
......@@ -98,9 +98,9 @@ SKIP: {
ok(
$res->[2]->[0] =~
m#iframe src="http://auth.idp.com(/saml/relaySingleLogoutPOST)\?(relay=.*?)"#s,
m#iframe src="http://auth.idp.com(/saml/relaySingleLogoutPOST)\?(relay=.*?)"#s,
'Get iframe request'
) or explain($res,'');
) or explain( $res, '' );
ok(
$res = $issuer->_get(
......@@ -114,7 +114,7 @@ SKIP: {
expectOK($res);
ok(
$res->[2]->[0] =~
m#<form.+?action="http://auth.sp.com(/saml/proxySingleLogout)".+?method="post"#,
m#<form.+?action="http://auth.sp.com(/saml/proxySingleLogout)".+?method="post"#,
'Form method is POST'
);
$url = $1;
......@@ -139,7 +139,7 @@ SKIP: {
expectOK($res);
ok(
$res->[2]->[0] =~
m#<form.+?action="http://auth.idp.com(/saml/singleLogoutReturn)".+?method="post"#,
m#<form.+?action="http://auth.idp.com(/saml/singleLogoutReturn)".+?method="post"#,
'Form method is POST'
);
$url = $1;
......@@ -151,7 +151,7 @@ SKIP: {
$s = "SAMLResponse=$1";
# Post SAML logout response to IdP
switch('issuer');
switch ('issuer');
ok(
$res = $sp->_post(
$url, IO::String->new($s),
......@@ -192,6 +192,7 @@ SKIP: {
$res->[2],
' <input type="hidden" name="SAMLRequest" id="SAMLRequest" value="...'
);
#print STDERR Dumper($res);
}
......
......@@ -38,7 +38,8 @@ SKIP: {
),
'Unauth SP request'
);
expectRedirection($res, 'http://auth.idp.com/cas/login?service=http://auth.sp.com/');
expectRedirection( $res,
'http://auth.idp.com/cas/login?service=http://auth.sp.com/' );
# Query IdP
switch ('issuer');
......@@ -70,7 +71,8 @@ SKIP: {
),
'Post authentication'
);
my ($query) = expectRedirection($res,qr#^http://auth.sp.com/\?(ticket=[^&]+)$#);
my ($query) =
expectRedirection( $res, qr#^http://auth.sp.com/\?(ticket=[^&]+)$# );
my $idpId = expectCookie($res);
# Back to SP
......@@ -82,7 +84,7 @@ SKIP: {
# Test authentication
ok( $res = $sp->_get( '/', cookie => "lemonldap=$spId" ), 'Get / on SP' );
expectOK($res);
expectAuthenticatedAs($res,'dwho');
expectAuthenticatedAs( $res, 'dwho' );
# Logout initiated by SP
ok(
......@@ -102,7 +104,7 @@ SKIP: {
);
# Query IdP with iframe src
my $url = $1;
my $url = $1;
$query = $2;
switch ('issuer');
ok(
......
......@@ -44,7 +44,7 @@ ok(
'GET request with good url'
);
count(1);
expectRedirection($res,"http://test1.example.com/?ID=$id");
expectRedirection( $res, "http://test1.example.com/?ID=$id" );
# Test not logged access
ok(
......
......@@ -91,7 +91,7 @@ sub expectCookie {
$cookieName ||= 'lemonldap';
my $cookies = getCookies($res);
my $id;
ok( defined($id = $cookies->{$cookieName}), "Get cookie $cookieName" )
ok( defined( $id = $cookies->{$cookieName} ), "Get cookie $cookieName" )
or explain( $res->[1], "Set-Cookie: $cookieName=something" );
count(1);
return $id;
......
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