summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree2
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-09-20 14:17:34 +0100
committerSteve Block <steveblock@google.com>2010-09-22 15:33:05 +0100
commit0e1d6876f93332eb430d31d48f627ad812abb29d (patch)
tree720b9957725544f5bdb3cd223acf0b61813b37e4 /tests/DumpRenderTree2
parent34f3851e9534b19ab0f02d3eb11f52ddb2635530 (diff)
downloadframeworks_base-0e1d6876f93332eb430d31d48f627ad812abb29d.zip
frameworks_base-0e1d6876f93332eb430d31d48f627ad812abb29d.tar.gz
frameworks_base-0e1d6876f93332eb430d31d48f627ad812abb29d.tar.bz2
Fix a bug in DumpRenderTree2's run_apache2.py script
We use a printf style approach when setting the run command in the command string to be executed. When doing so, the printf must be applied to only the relevant part of the string. This avoids problems in the case that other parts of the string contain special character sequences, such as '%s' in a custom log directive. Change-Id: I87df773a2872320386a34cb6a5041a9e0ba6f31e
Diffstat (limited to 'tests/DumpRenderTree2')
-rwxr-xr-xtests/DumpRenderTree2/assets/run_apache2.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/DumpRenderTree2/assets/run_apache2.py b/tests/DumpRenderTree2/assets/run_apache2.py
index c799b5c..5edead1 100755
--- a/tests/DumpRenderTree2/assets/run_apache2.py
+++ b/tests/DumpRenderTree2/assets/run_apache2.py
@@ -109,18 +109,17 @@ def main(options, args):
# Try to execute the commands
logging.info("Will " + run_cmd + " apache2 server.")
- 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.
+ # to a different PidFile it will not work and will result in a second apache2 instance.
if (run_cmd == 'restart'):
logging.info("First will stop...")
- execute_cmd(cmd_template % ('stop'))
+ execute_cmd(export_envvars_cmd + " && " + (apache2_restart_template % ('stop')) + directives + conf_file_cmd)
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))
+ execute_cmd(export_envvars_cmd + " && " + (apache2_restart_template % (run_cmd)) + directives + conf_file_cmd)
def execute_cmd(cmd):
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)