3 # Copyright (C) 2014 Simo Sorce <simo@redhat.com>
5 # see file 'COPYING' for use and warranty information
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 from helpers import http # pylint: disable=relative-import
27 if __name__ == '__main__':
32 user = pwd.getpwuid(os.getuid())[0]
34 sess = http.HttpSessions()
35 sess.add_server(idpname, 'http://127.0.0.10:45080', user, 'ipsilon')
36 sess.add_server(spname, 'http://127.0.0.11:45081')
38 print "test1: Authenticate to IDP ...",
40 sess.auth_to_idp(idpname)
41 except Exception, e: # pylint: disable=broad-except
42 print >> sys.stderr, " ERROR: %s" % repr(e)
46 print "test1: Add SP Metadata to IDP ...",
48 sess.add_sp_metadata(idpname, spname)
49 except Exception, e: # pylint: disable=broad-except
50 print >> sys.stderr, " ERROR: %s" % repr(e)
54 print "test1: Access SP Protected Area ...",
56 page = sess.fetch_page(idpname, 'http://127.0.0.11:45081/sp/')
57 page.expected_value('text()', 'WORKS!')
59 print >> sys.stderr, " ERROR: %s" % repr(e)