Skip to content

Commit

Permalink
Speed up Tomcat startup (SOFTWARE-2383)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhlin committed Aug 1, 2016
1 parent 448a65d commit 6564784
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions osgtest/tests/test_24_tomcat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ def test_02_config_tomcat_properties(self):
new_contents = pattern.sub('crlRequired="false"', old_contents)
files.write(server_xml_path, new_contents, owner='tomcat')

def test_03_config_tomcat_endorsed_jars(self):
def test_03_config_tomcat(self):
core.skip_ok_unless_installed(tomcat.pkgname())

old_contents = files.read(tomcat.conffile(), True)
line = 'JAVA_ENDORSED_DIRS="${JAVA_ENDORSED_DIRS+$JAVA_ENDORSED_DIRS:}/usr/share/voms-admin/endorsed"\n'
if old_contents.find(line) == -1:
new_contents = old_contents + "\n" + line
files.write(tomcat.conffile(), new_contents, owner='tomcat')
# Endorse JARs
lines = ['JAVA_ENDORSED_DIRS="${JAVA_ENDORSED_DIRS+$JAVA_ENDORSED_DIRS:}/usr/share/voms-admin/endorsed"']
# Improve Tomcat 7 startup times (SOFTWARE-2383)
lines.append('JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"')

for line in lines:
if old_contents.find(line) != -1:
lines.remove(line)

new_contents = '\n'.join([old_contents] + lines)
files.write(tomcat.conffile(), new_contents, owner='tomcat')

def test_04_configure_gratia(self):
core.skip_ok_unless_installed(tomcat.pkgname(), 'gratia-service')
Expand Down

0 comments on commit 6564784

Please sign in to comment.