Make it possible to use PluginLoader without store
[cascardo/ipsilon.git] / tests / attrs.py
index f01dae4..2739751 100755 (executable)
@@ -1,22 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (C) 2014  Simo Sorce <simo@redhat.com>
-#
-# see file 'COPYING' for use and warranty information
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
+# Copyright (C) 2014 Ipsilon project Contributors, for license see COPYING
 
 from helpers.common import IpsilonTestBase  # pylint: disable=relative-import
 from helpers.http import HttpSessions  # pylint: disable=relative-import
@@ -29,6 +13,7 @@ from string import Template
 idp_g = {'TEMPLATES': '${TESTDIR}/templates/install',
          'CONFDIR': '${TESTDIR}/etc',
          'DATADIR': '${TESTDIR}/lib',
+         'CACHEDIR': '${TESTDIR}/cache',
          'HTTPDCONFD': '${TESTDIR}/${NAME}/conf.d',
          'STATICDIR': '${ROOTDIR}',
          'BINDIR': '${ROOTDIR}/ipsilon',
@@ -41,9 +26,8 @@ idp_a = {'hostname': '${ADDRESS}:${PORT}',
          'instance': '${NAME}',
          'secure': 'no',
          'testauth': 'yes',
-         'info_nss': 'yes',
          'pam': 'no',
-         'krb': 'no',
+         'gssapi': 'no',
          'ipa': 'no',
          'server_debugging': 'True'}
 
@@ -63,11 +47,7 @@ sp_a = {'hostname': '${ADDRESS}:${PORT}',
 
 def fixup_sp_httpd(httpdir):
     merge = """
-    MellonSetEnv "UID" "uidNumber"
-    MellonSetEnv "GID" "gidNumber"
-    MellonSetEnv "HOME" "homeDirectory"
-    MellonSetEnv "GECOS" "gecos"
-    MellonSetEnv "SHELL" "loginShell"
+    MellonSetEnv "FULLNAME" "fullname"
 </Location>"""
     with open(httpdir + '/conf.d/ipsilon-saml.conf', 'r') as f:
         conf = f.read()
@@ -89,7 +69,7 @@ Alias /sp ${HTTPDIR}/sp
     with open(httpdir + '/conf.d/ipsilon-saml.conf', 'a') as f:
         f.write(text)
 
-    index = """<!--#echo var="MELLON_UID" -->"""
+    index = """<!--#echo var="MELLON_FULLNAME" -->"""
     os.mkdir(httpdir + '/sp')
     with open(httpdir + '/sp/index.shtml', 'w') as f:
         f.write(index)
@@ -127,8 +107,7 @@ if __name__ == '__main__':
 
     idpname = 'idp1'
     spname = 'sp1'
-    userpwd = pwd.getpwuid(os.getuid())
-    user = userpwd[0]
+    user = pwd.getpwuid(os.getuid())[0]
 
     sess = HttpSessions()
     sess.add_server(idpname, 'http://127.0.0.10:45080', user, 'ipsilon')
@@ -154,7 +133,7 @@ if __name__ == '__main__':
     try:
         page = sess.fetch_page(idpname,
                                'http://127.0.0.11:45081/sp/index.shtml')
-        page.expected_value('text()', str(userpwd[2]))
+        page.expected_value('text()', 'Test User %s' % user)
     except ValueError, e:
         print >> sys.stderr, " ERROR: %s" % repr(e)
         sys.exit(1)