summaryrefslogtreecommitdiffstats
path: root/tests/magtests.py
diff options
context:
space:
mode:
authorRobbie Harwood <rharwood@redhat.com>2016-12-20 15:32:04 -0500
committerSimo Sorce <simo@redhat.com>2017-01-03 11:36:37 -0500
commit0d6a1a390a578ab8be5bc0d6225e3e0b07dc7eba (patch)
tree69afefb17ace718db6264fa281b6eba9228bb36c /tests/magtests.py
parent4e80ca609d9978dfc2589b6eced209e3f38187cf (diff)
downloadmod_auth_gssapi-0d6a1a390a578ab8be5bc0d6225e3e0b07dc7eba.tar.gz
mod_auth_gssapi-0d6a1a390a578ab8be5bc0d6225e3e0b07dc7eba.tar.xz
mod_auth_gssapi-0d6a1a390a578ab8be5bc0d6225e3e0b07dc7eba.zip
Make test suite runnable on Debian-likes
This is mostly gunk around how the webserver is called and what is built-in versus a module. I have mostly added templating logic for commenting pieces of the conf file. Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Isaac Boukris <iboukris@gmail.com> Closes #118
Diffstat (limited to 'tests/magtests.py')
-rwxr-xr-xtests/magtests.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/magtests.py b/tests/magtests.py
index 074e2f0..3a29365 100755
--- a/tests/magtests.py
+++ b/tests/magtests.py
@@ -216,7 +216,15 @@ def setup_http(testdir, wrapenv):
os.mkdir(os.path.join(httpdir, 'conf.d'))
os.mkdir(os.path.join(httpdir, 'html'))
os.mkdir(os.path.join(httpdir, 'logs'))
- os.symlink('/etc/httpd/modules', os.path.join(httpdir, 'modules'))
+
+ distro = "Fedora"
+ moddir = "/etc/httpd/modules"
+ if not os.path.exists(moddir):
+ distro = "Debian"
+ moddir = "/usr/lib/apache2/modules"
+ if not os.path.exists(moddir):
+ raise ValueError("Could not find Apache module directory!")
+ os.symlink(moddir, os.path.join(httpdir, 'modules'))
shutil.copy('src/.libs/mod_auth_gssapi.so', httpdir)
@@ -236,8 +244,9 @@ def setup_http(testdir, wrapenv):
'MALLOC_PERTURB_': str(random.randint(0, 32767) % 255 + 1)}
httpenv.update(wrapenv)
- httpproc = subprocess.Popen(['httpd', '-DFOREGROUND', '-f', config],
- env=httpenv, preexec_fn=os.setsid)
+ httpd = "httpd" if distro == "Fedora" else "apache2"
+ httpproc = subprocess.Popen([httpd, '-DFOREGROUND', '-f', config],
+ env=httpenv, preexec_fn=os.setsid)
return httpproc