Commit 60d05c48 authored by Clément OUDOT's avatar Clément OUDOT

Adpat test to bypass selection screen when only one SAML IDP (#1465)

parent 338b9587
......@@ -9,7 +9,7 @@ BEGIN {
require 't/test-lib.pm';
}
my $maintests = 18;
my $maintests = 17;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -65,9 +65,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 20;
my $maintests = 19;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -49,9 +49,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 20;
my $maintests = 18;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -51,19 +51,7 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
my ( $host, $url, $query ) = expectForm( $res, '#', undef, 'confirm' );
ok(
$res->[2]->[0] =~
m#<button type="submit".+?val="http://auth.idp.com/saml/metadata"#s,
'Found confirm key'
)
or explain(
$res->[2],
'<input type="hidden" id="confirm" name="confirm" value="<base64 value>" />'
);
$query .= '&idp=http://auth.idp.com/saml/metadata';
# Choose idp on sp
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 17;
my $maintests = 16;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -49,9 +49,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -11,7 +11,7 @@ BEGIN {
}
eval { unlink 't/userdb.db' };
my $maintests = 16;
my $maintests = 15;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -75,9 +75,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 16;
my $maintests = 15;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -63,9 +63,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 10;
my $maintests = 8;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
......@@ -51,19 +51,7 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
my ( $host, $url, $query ) = expectForm( $res, '#', undef, 'confirm' );
ok(
$res->[2]->[0] =~
m#<button type="submit".+?val="http://auth.idp.com/saml/metadata"#s,
'Found confirm key'
)
or explain(
$res->[2],
'<input type="hidden" id="confirm" name="confirm" value="<base64 value>" />'
);
$query .= '&idp=http://auth.idp.com/saml/metadata';
# Choose idp on sp
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 21;
my $maintests = 20;
my $debug = 'error';
my ( $issuer, $proxy, $sp, $res );
my %handlerOR = ( issuer => [], proxy => [], sp => [] );
......@@ -88,9 +88,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
......@@ -10,7 +10,7 @@ BEGIN {
require 't/saml-lib.pm';
}
my $maintests = 19;
my $maintests = 18;
my $debug = 'error';
my ( $issuer, $proxy, $sp, $res );
my %handlerOR = ( issuer => [], proxy => [], sp => [] );
......@@ -89,9 +89,6 @@ SKIP: {
'Unauth SP request'
);
expectOK($res);
ok( expectCookie( $res, 'lemonldapidp' ) == 0, 'IDP cookie deleted' )
or explain( $res->[1],
'Set-Cookie => lemonldapidp=0; domain=.sp.com; path=/; expires=-1d' );
ok(
$res->[2]->[0] =~
/<input type="hidden".+?id="confirm".+?value="(.+?)"/s,
......
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