diff --git a/src/mod_sso/test/httpd_integration_test.py b/src/mod_sso/test/httpd_integration_test.py index b6cde00605239570aa2f659b4b5eab66633830c7..973eb1e3b8b4667173a838f334b812da78e1fb3d 100755 --- a/src/mod_sso/test/httpd_integration_test.py +++ b/src/mod_sso/test/httpd_integration_test.py @@ -57,7 +57,7 @@ def _start_httpd(public_key, config_file): return httpd -def _stop_httpd(httpd): +def _stop_httpd(httpd, dump_log=False): httpd.terminate() time.sleep(1) try: @@ -65,8 +65,8 @@ def _stop_httpd(httpd): except OSError: pass - #dump_log = (os.getenv('DUMP_APACHE_LOG') == '1') - dump_log = True + if os.getenv('DUMP_APACHE_LOG'): + dump_log = True status = httpd.wait() if os.WIFEXITED(status): if os.WEXITSTATUS(status) != 0: @@ -80,6 +80,7 @@ def _stop_httpd(httpd): dump_log = True if dump_log: + print('*** APACHE LOG ***') with open(APACHE_LOG) as fd: for line in fd: print(line.rstrip('\n')) @@ -138,6 +139,7 @@ class HttpdKeyLoadingTest(unittest.TestCase): class HttpdIntegrationTestBase(unittest.TestCase): CONFIG = None + DUMP_LOG = False def setUp(self): self.public, self.secret = sso.generate_keys() @@ -145,7 +147,7 @@ class HttpdIntegrationTestBase(unittest.TestCase): self.httpd = _start_httpd(self.public, self.CONFIG) def tearDown(self): - _stop_httpd(self.httpd) + _stop_httpd(self.httpd, self.DUMP_LOG) def _ticket(self, user="testuser", group="group1", service="service.example.com/", nonce=None): @@ -377,6 +379,7 @@ class HttpdIntegrationTest(HttpdIntegrationTestBase): class HttpdIntegrationTestWithNonces(HttpdIntegrationTestBase): CONFIG = 'test-httpd-2.4-nonces.conf' + DUMP_LOG = True def setUp(self): with open('session.key', 'wb') as fd: