diff options
author | Maksymilian Osowski <maxosowski@google.com> | 2010-09-17 14:43:03 +0100 |
---|---|---|
committer | Maksymilian Osowski <maxosowski@google.com> | 2010-09-17 15:27:34 +0100 |
commit | 4af7705631880a8f0b1d2c34df47be4b554b7a15 (patch) | |
tree | 42f8796a2b8960dd05b47535b1c6e2e1d45dd425 /tests/DumpRenderTree2 | |
parent | 44ce3242a984bc3959e43fc832966d7f0ed61159 (diff) | |
download | frameworks_base-4af7705631880a8f0b1d2c34df47be4b554b7a15.zip frameworks_base-4af7705631880a8f0b1d2c34df47be4b554b7a15.tar.gz frameworks_base-4af7705631880a8f0b1d2c34df47be4b554b7a15.tar.bz2 |
Changed the behaviour of run_apache2.py restart.
Now it explicitly stops and starts the server and not just invokes apache2 -k restart
Change-Id: I74cfa9c3388552fcc56b62c5ab614262ca540d0b
Diffstat (limited to 'tests/DumpRenderTree2')
-rwxr-xr-x | tests/DumpRenderTree2/assets/run_apache2.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/DumpRenderTree2/assets/run_apache2.py b/tests/DumpRenderTree2/assets/run_apache2.py index 25638ba..6c3b2f2 100755 --- a/tests/DumpRenderTree2/assets/run_apache2.py +++ b/tests/DumpRenderTree2/assets/run_apache2.py @@ -27,6 +27,7 @@ import os import subprocess import logging import optparse +import time def main(options, args): if len(args) < 1: @@ -71,7 +72,7 @@ def main(options, args): custom_log_path = os.path.join(tmp_WebKit, "apache2-access.log") # Prepare the command to (re)start/stop the server with specified settings - apache2_restart_cmd = "apache2 -k " + run_cmd + apache2_restart_template = "apache2 -k %s" directives = " -c \"ServerRoot " + android_tree_root + "\"" # We use http/tests as the document root as the HTTP tests use hardcoded @@ -104,7 +105,20 @@ def main(options, args): # Try to execute the commands logging.info("Will " + run_cmd + " apache2 server.") - cmd = export_envvars_cmd + " && " + apache2_restart_cmd + directives + conf_file_cmd + cmd_template = export_envvars_cmd + " && " + apache2_restart_template + directives + conf_file_cmd + + # It is worth noting here that if the configuration file with which we restart the server points + # to a different PidFile it will not work and result in second apache2 instance. + if (run_cmd == 'restart'): + logging.info("First will stop...") + execute_cmd(cmd_template % ('stop')) + logging.info("Stopped. Will start now...") + # We need to sleep breifly to avoid errors with apache being stopped and started too quickly + time.sleep(0.5) + + execute_cmd(cmd_template % (run_cmd)) + +def execute_cmd(cmd): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() |