Commit 8b6827ec authored by ale's avatar ale
Browse files

load some default auth/authz apache2 modules for a more realistic mod_sso test

parent 9e52a90a
......@@ -12,17 +12,21 @@ import sso
# Allow overriding the apache2 executable location from the environment.
APACHE_BIN = os.getenv('APACHE_BIN', '/usr/sbin/apache2')
if not os.path.exists(APACHE_BIN):
raise Exception('Apache2 could not be found in %s, this test cannot run' %
APXS_BIN = os.getenv('APXS_BIN', '/usr/bin/apxs2')
for exe in (APACHE_BIN, APXS_BIN):
if not os.path.exists(exe):
raise Exception('%s not found, this test cannot run' % exe)
def _start_httpd(public_key):
with open('public.key', 'w') as fd:
cmd = ["env", "TESTROOT=%s" % os.getcwd(),
APACHE_BIN, "-f", os.path.join(os.getcwd(), "test-httpd.conf"), "-X"]
httpd = subprocess.Popen(cmd)
env = dict(os.environ)
env['TESTROOT'] = os.getcwd()
env['MODULEDIR'] = subprocess.check_output(
[APXS_BIN, '-q', 'LIBEXECDIR']).strip()
cmd = [APACHE_BIN, "-f", os.path.join(os.getcwd(), "test-httpd.conf"), "-X"]
httpd = subprocess.Popen(cmd, env=env)
print 'httpd pid:',
return httpd
LoadModule auth_basic_module ${MODULEDIR}/
LoadModule authz_default_module ${MODULEDIR}/
LoadModule authz_user_module ${MODULEDIR}/
LoadModule sso_module ${TESTROOT}/../.libs/
LoadModule cgi_module /usr/lib/apache2/modules/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment