summaryrefslogtreecommitdiffstats
path: root/tests/testlogout.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2015-03-30 11:42:10 -0400
committerRob Crittenden <rcritten@redhat.com>2015-03-31 12:53:00 -0400
commitc44b299b7ee92edae70c726ac359a9eb9489b5b7 (patch)
treebc6f466d3fbb323a1168f076231c4bcf0215fcea /tests/testlogout.py
parentdb41f6ea5ac2b4648350900791e32a83d0974e14 (diff)
downloadipsilon.git-c44b299b7ee92edae70c726ac359a9eb9489b5b7.tar.gz
ipsilon.git-c44b299b7ee92edae70c726ac359a9eb9489b5b7.tar.xz
ipsilon.git-c44b299b7ee92edae70c726ac359a9eb9489b5b7.zip
IdP-initiated logout for current userticket_87
Perform Single Logout for the current user when a logout is initiated in the IdP. A fake initial session is created. In the current logout code the initial logout requestor holds the final redirect URL. In this case it redirects back to the root IdP page. https://fedorahosted.org/ipsilon/ticket/87 Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Diffstat (limited to 'tests/testlogout.py')
-rwxr-xr-xtests/testlogout.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/testlogout.py b/tests/testlogout.py
index b192739..5018066 100755
--- a/tests/testlogout.py
+++ b/tests/testlogout.py
@@ -291,3 +291,80 @@ if __name__ == '__main__':
print >> sys.stderr, " ERROR: %s" % repr(e)
sys.exit(1)
print " SUCCESS"
+
+ # Test IdP-initiated logout
+ print "testlogout: Access SP Protected Area of SP1...",
+ try:
+ page = sess.fetch_page(idpname, 'http://127.0.0.11:45081/sp/')
+ page.expected_value('text()', 'WORKS!')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Access SP Protected Area of SP2...",
+ try:
+ page = sess.fetch_page(idpname, 'http://127.0.0.10:45082/sp/')
+ page.expected_value('text()', 'WORKS!')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Access the IdP...",
+ try:
+ page = sess.fetch_page(idpname, 'http://127.0.0.10:45080/%s' % idpname)
+ page.expected_value('//div[@id="welcome"]/p/text()',
+ 'Welcome %s!' % user)
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: IdP-initiated logout ...",
+ try:
+ page = sess.fetch_page(idpname,
+ 'http://127.0.0.10:45080/%s/logout' % idpname)
+ page.expected_value('//div[@id="content"]/p/a/text()', 'Log In')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Ensure logout of SP1 ...",
+ try:
+ ensure_logout(sess, idpname, 'http://127.0.0.11:45081/sp/')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Ensure logout of SP2 ...",
+ try:
+ ensure_logout(sess, idpname, 'http://127.0.0.10:45082/sp/')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Access the IdP...",
+ try:
+ page = sess.fetch_page(idpname,
+ 'http://127.0.0.10:45080/%s/login' % idpname)
+ page.expected_value('//div[@id="welcome"]/p/text()',
+ 'Welcome %s!' % user)
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: IdP-initiated logout with no SP sessions...",
+ try:
+ page = sess.fetch_page(idpname,
+ 'http://127.0.0.10:45080/%s/logout' % idpname)
+ page.expected_value('//div[@id="logout"]/p//text()',
+ 'Successfully logged out.')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"