Create cache directory for storing images for SP Portal
[cascardo/ipsilon.git] / tests / helpers / common.py
index 8e6c53b..87cbd44 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
 
 import ConfigParser
 import io
@@ -112,15 +96,16 @@ class IpsilonTestBase(object):
         os.mkdir(os.path.join(self.testdir, 'lib'))
         os.mkdir(os.path.join(self.testdir, 'lib', test.name))
         os.mkdir(os.path.join(self.testdir, 'log'))
+        os.mkdir(os.path.join(self.testdir, 'cache'))
 
     def generate_profile(self, global_opts, args_opts, name, addr, port,
                          nameid='unspecified'):
         newconf = ConfigParser.ConfigParser()
         newconf.add_section('globals')
-        for k in global_opts.keys():
+        for k in global_opts:
             newconf.set('globals', k, global_opts[k])
         newconf.add_section('arguments')
-        for k in args_opts.keys():
+        for k in args_opts:
             newconf.set('arguments', k, args_opts[k])
 
         profile = io.BytesIO()
@@ -193,6 +178,7 @@ class IpsilonTestBase(object):
         p = subprocess.Popen(['/usr/sbin/httpd', '-DFOREGROUND', '-f', conf],
                              env=env, preexec_fn=os.setsid)
         self.processes.append(p)
+        return p
 
     def start_pgdb_server(self, datadir, rundir, log, addr, port, env):
         p = subprocess.Popen(['/usr/bin/pg_ctl', 'start', '-D', datadir, '-o',
@@ -202,7 +188,8 @@ class IpsilonTestBase(object):
                              env=env, preexec_fn=os.setsid)
         self.processes.append(p)
         p.wait()
-        for d in ['adminconfig', 'users', 'transactions', 'sessions']:
+        for d in ['adminconfig', 'users', 'transactions', 'sessions',
+                  'saml2.sessions.db']:
             cmd = ['/usr/bin/createdb', '-h', addr, '-p', port, d]
             subprocess.check_call(cmd, env=env)