| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 import os | 32 import os |
| 33 import socket | 33 import socket |
| 34 | 34 |
| 35 from webkitpy.layout_tests.servers import server_base | 35 from webkitpy.layout_tests.servers import server_base |
| 36 | 36 |
| 37 | 37 |
| 38 _log = logging.getLogger(__name__) | 38 _log = logging.getLogger(__name__) |
| 39 | 39 |
| 40 | 40 |
| 41 class ApacheHTTP(server_base.ServerBase): | 41 class ApacheHTTP(server_base.ServerBase): |
| 42 def __init__(self, port_obj, output_dir, additional_dirs=None, number_of_ser
vers=None): | 42 def __init__(self, port_obj, output_dir, additional_dirs, number_of_servers)
: |
| 43 super(ApacheHTTP, self).__init__(port_obj, output_dir) | 43 super(ApacheHTTP, self).__init__(port_obj, output_dir) |
| 44 # We use the name "httpd" instead of "apache" to make our paths (e.g. th
e pid file: /tmp/WebKit/httpd.pid) | 44 # We use the name "httpd" instead of "apache" to make our paths (e.g. th
e pid file: /tmp/WebKit/httpd.pid) |
| 45 # match old-run-webkit-tests: https://bugs.webkit.org/show_bug.cgi?id=63
956 | 45 # match old-run-webkit-tests: https://bugs.webkit.org/show_bug.cgi?id=63
956 |
| 46 self._name = 'httpd' | 46 self._name = 'httpd' |
| 47 self._mappings = [{'port': 8000}, | 47 self._mappings = [{'port': 8000}, |
| 48 {'port': 8080}, | 48 {'port': 8080}, |
| 49 {'port': 8443, 'sslcert': True}] | 49 {'port': 8443, 'sslcert': True}] |
| 50 self._number_of_servers = number_of_servers | 50 self._number_of_servers = number_of_servers |
| 51 | 51 |
| 52 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) | 52 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 retval = proc.returncode | 150 retval = proc.returncode |
| 151 err = proc.stderr.read() | 151 err = proc.stderr.read() |
| 152 if retval or len(err): | 152 if retval or len(err): |
| 153 raise server_base.ServerError('Failed to stop %s: %s' % (self._name,
err)) | 153 raise server_base.ServerError('Failed to stop %s: %s' % (self._name,
err)) |
| 154 | 154 |
| 155 # For some reason apache isn't guaranteed to have actually stopped after | 155 # For some reason apache isn't guaranteed to have actually stopped after |
| 156 # the stop command returns, so we wait a little while longer for the | 156 # the stop command returns, so we wait a little while longer for the |
| 157 # pid file to be removed. | 157 # pid file to be removed. |
| 158 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p
id_file)): | 158 if not self._wait_for_action(lambda: not self._filesystem.exists(self._p
id_file)): |
| 159 raise server_base.ServerError('Failed to stop %s: pid file still exi
sts' % self._name) | 159 raise server_base.ServerError('Failed to stop %s: pid file still exi
sts' % self._name) |
| OLD | NEW |