Commit 8b6827ec authored by ale's avatar ale

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' %
APACHE_BIN)
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:
fd.write(public_key)
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:', httpd.pid
time.sleep(1)
return httpd
......
LoadModule auth_basic_module ${MODULEDIR}/mod_auth_basic.so
LoadModule authz_default_module ${MODULEDIR}/mod_authz_default.so
LoadModule authz_user_module ${MODULEDIR}/mod_authz_user.so
LoadModule sso_module ${TESTROOT}/../.libs/mod_sso.so
LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so
......
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