- 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: Logout from both ...",
- try:
- page = sess.fetch_page(idpname, '%s/%s?%s' % (
- 'http://127.0.0.11:45081', 'saml2/logout',
- 'ReturnTo=http://127.0.0.11:45081/open/logged_out.html'))
- page.expected_value('text()', 'Logged out')
- 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"
+ # Test logout from each of the SP's in the list to ensure that the
+ # order of logout doesn't matter.
+ for sporder in splist:
+ print "testlogout: Access SP Protected Area of each SP ...",
+ for sp in splist:
+ spname = sp['nameid']
+ spurl = 'http://%s:%s/sp/' % (sp['addr'], sp['port'])
+ try:
+ page = sess.fetch_page(idpname, spurl)
+ page.expected_value('text()', 'WORKS!')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Initiate logout from %s ..." % sporder['nameid'],
+ try:
+ logouturl = 'http://%s:%s' % (sp['addr'], sp['port'])
+ page = sess.fetch_page(idpname, '%s/%s?%s' % (
+ logouturl, 'saml2/logout',
+ 'ReturnTo=http://127.0.0.11:45081/open/logged_out.html'))
+ page.expected_value('text()', 'Logged out')
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"
+
+ print "testlogout: Ensure logout of each SP ...",
+ for sp in splist:
+ spname = sp['nameid']
+ spurl = 'http://%s:%s/sp/' % (sp['addr'], sp['port'])
+ try:
+ ensure_logout(sess, idpname, spurl)
+ except ValueError, e:
+ print >> sys.stderr, " ERROR: %s" % repr(e)
+ sys.exit(1)
+ print " SUCCESS"