Skip to content
Snippets Groups Projects
Commit 61c812fd authored by ale's avatar ale
Browse files

Try a different DUMP_LOG method

parent cedfbb3e
No related branches found
No related tags found
1 merge request!4Drop Python 2 support
......@@ -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,7 +65,7 @@ def _stop_httpd(httpd):
except OSError:
pass
#dump_log = (os.getenv('DUMP_APACHE_LOG') == '1')
if os.getenv('DUMP_APACHE_LOG'):
dump_log = True
status = httpd.wait()
if os.WIFEXITED(status):
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment