Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py |
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py |
index 6fe127dd6d468de10a0cfa82b537b3d50c92f027..6f376a9552cc9d3cebb04aa519e9f1e2f9352880 100644 |
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py |
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/apache_http.py |
@@ -25,7 +25,6 @@ |
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- |
"""Start and stop the Apache HTTP server as it is used by the layout tests.""" |
import logging |
@@ -34,7 +33,6 @@ import socket |
from webkitpy.layout_tests.servers import server_base |
- |
_log = logging.getLogger(__name__) |
@@ -45,9 +43,7 @@ class ApacheHTTP(server_base.ServerBase): |
# match old-run-webkit-tests: https://bugs.webkit.org/show_bug.cgi?id=63956 |
self._name = 'httpd' |
self._log_prefixes = ('access_log', 'error_log') |
- self._mappings = [{'port': 8000}, |
- {'port': 8080}, |
- {'port': 8443, 'sslcert': True}] |
+ self._mappings = [{'port': 8000}, {'port': 8080}, {'port': 8443, 'sslcert': True}] |
self._number_of_servers = number_of_servers |
self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % self._name) |
@@ -71,28 +67,38 @@ class ApacheHTTP(server_base.ServerBase): |
start_cmd = [ |
executable, |
- '-f', '%s' % self._port_obj.path_to_apache_config_file(), |
- '-C', 'ServerRoot "%s"' % server_root, |
- '-C', 'DocumentRoot "%s"' % document_root, |
- '-c', 'Alias /js-test-resources "%s"' % js_test_resources_dir, |
- '-c', 'Alias /forms-test-resources "%s"' % forms_test_resources_dir, |
- '-c', 'Alias /media-resources "%s"' % media_resources_dir, |
- '-c', 'TypesConfig "%s"' % mime_types_path, |
- '-c', 'CustomLog "%s" common' % self._access_log_path, |
- '-c', 'ErrorLog "%s"' % self._error_log_path, |
- '-c', 'PidFile %s' % self._pid_file, |
- '-c', 'SSLCertificateFile "%s"' % cert_file, |
- '-c', 'Alias /inspector-sources "%s"' % inspector_sources_dir, |
- ] |
+ '-f', |
+ '%s' % self._port_obj.path_to_apache_config_file(), |
+ '-C', |
+ 'ServerRoot "%s"' % server_root, |
+ '-C', |
+ 'DocumentRoot "%s"' % document_root, |
+ '-c', |
+ 'Alias /js-test-resources "%s"' % js_test_resources_dir, |
+ '-c', |
+ 'Alias /forms-test-resources "%s"' % forms_test_resources_dir, |
+ '-c', |
+ 'Alias /media-resources "%s"' % media_resources_dir, |
+ '-c', |
+ 'TypesConfig "%s"' % mime_types_path, |
+ '-c', |
+ 'CustomLog "%s" common' % self._access_log_path, |
+ '-c', |
+ 'ErrorLog "%s"' % self._error_log_path, |
+ '-c', |
+ 'PidFile %s' % self._pid_file, |
+ '-c', |
+ 'SSLCertificateFile "%s"' % cert_file, |
+ '-c', |
+ 'Alias /inspector-sources "%s"' % inspector_sources_dir, |
+ ] |
if self._is_win: |
start_cmd += ['-c', "ThreadsPerChild %d" % (self._number_of_servers * 8)] |
else: |
- start_cmd += ['-c', "StartServers %d" % self._number_of_servers, |
- '-c', "MinSpareServers %d" % self._number_of_servers, |
- '-c', "MaxSpareServers %d" % self._number_of_servers, |
- '-C', 'User "%s"' % os.environ.get('USERNAME', os.environ.get('USER', '')), |
- '-k', 'start'] |
+ start_cmd += ['-c', "StartServers %d" % self._number_of_servers, '-c', "MinSpareServers %d" % self._number_of_servers, |
+ '-c', "MaxSpareServers %d" % self._number_of_servers, '-C', |
+ 'User "%s"' % os.environ.get('USERNAME', os.environ.get('USER', '')), '-k', 'start'] |
enable_ipv6 = self._port_obj.http_server_supports_ipv6() |
# Perform part of the checks Apache's APR does when trying to listen to |
@@ -121,11 +127,15 @@ class ApacheHTTP(server_base.ServerBase): |
if additional_dirs: |
self._start_cmd = start_cmd |
for alias, path in additional_dirs.iteritems(): |
- start_cmd += ['-c', 'Alias %s "%s"' % (alias, path), |
- # Disable CGI handler for additional dirs. |
- '-c', '<Location %s>' % alias, |
- '-c', 'RemoveHandler .cgi .pl', |
- '-c', '</Location>'] |
+ start_cmd += ['-c', |
+ 'Alias %s "%s"' % (alias, path), |
+ # Disable CGI handler for additional dirs. |
+ '-c', |
+ '<Location %s>' % alias, |
+ '-c', |
+ 'RemoveHandler .cgi .pl', |
+ '-c', |
+ '</Location>'] |
self._start_cmd = start_cmd |
@@ -158,10 +168,10 @@ class ApacheHTTP(server_base.ServerBase): |
self._executive.kill_process(self._pid) |
return |
- proc = self._executive.popen([self._port_obj.path_to_apache(), |
- '-f', self._port_obj.path_to_apache_config_file(), |
- '-c', 'PidFile "%s"' % self._pid_file, |
- '-k', 'stop'], stderr=self._executive.PIPE) |
+ proc = self._executive.popen( |
+ [self._port_obj.path_to_apache(), '-f', self._port_obj.path_to_apache_config_file(), '-c', |
+ 'PidFile "%s"' % self._pid_file, '-k', 'stop'], |
+ stderr=self._executive.PIPE) |
proc.wait() |
retval = proc.returncode |
err = proc.stderr.read() |