| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 _log = logging.getLogger(__name__) | 41 _log = logging.getLogger(__name__) |
| 42 | 42 |
| 43 | 43 |
| 44 class ApacheHTTP(server_base.ServerBase): | 44 class ApacheHTTP(server_base.ServerBase): |
| 45 def __init__(self, port_obj, output_dir, additional_dirs=None, number_of_ser
vers=None): | 45 def __init__(self, port_obj, output_dir, additional_dirs=None, number_of_ser
vers=None): |
| 46 """Args: | 46 """Args: |
| 47 port_obj: handle to the platform-specific routines | 47 port_obj: handle to the platform-specific routines |
| 48 output_dir: the absolute path to the layout test result directory | 48 output_dir: the absolute path to the layout test result directory |
| 49 """ | 49 """ |
| 50 super(ApacheHTTP, self).__init__(port_obj, number_of_servers) | 50 super(ApacheHTTP, self).__init__(port_obj, output_dir) |
| 51 self._number_of_servers = number_of_servers |
| 51 # We use the name "httpd" instead of "apache" to make our paths (e.g. th
e pid file: /tmp/WebKit/httpd.pid) | 52 # We use the name "httpd" instead of "apache" to make our paths (e.g. th
e pid file: /tmp/WebKit/httpd.pid) |
| 52 # match old-run-webkit-tests: https://bugs.webkit.org/show_bug.cgi?id=63
956 | 53 # match old-run-webkit-tests: https://bugs.webkit.org/show_bug.cgi?id=63
956 |
| 53 self._name = 'httpd' | 54 self._name = 'httpd' |
| 54 self._mappings = [{'port': 8000}, | 55 self._mappings = [{'port': 8000}, |
| 55 {'port': 8080}, | 56 {'port': 8080}, |
| 56 {'port': 8443, 'sslcert': True}] | 57 {'port': 8443, 'sslcert': True}] |
| 57 self._output_dir = output_dir | |
| 58 self._filesystem.maybe_make_directory(output_dir) | |
| 59 | 58 |
| 60 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) | 59 self._pid_file = self._filesystem.join(self._runtime_path, '%s.pid' % se
lf._name) |
| 61 | 60 |
| 62 test_dir = self._port_obj.layout_tests_dir() | 61 test_dir = self._port_obj.layout_tests_dir() |
| 63 js_test_resources_dir = self._filesystem.join(test_dir, "resources") | 62 js_test_resources_dir = self._filesystem.join(test_dir, "resources") |
| 64 media_resources_dir = self._filesystem.join(test_dir, "media") | 63 media_resources_dir = self._filesystem.join(test_dir, "media") |
| 65 mime_types_path = self._filesystem.join(test_dir, "http", "conf", "mime.
types") | 64 mime_types_path = self._filesystem.join(test_dir, "http", "conf", "mime.
types") |
| 66 cert_file = self._filesystem.join(test_dir, "http", "conf", "webkit-http
d.pem") | 65 cert_file = self._filesystem.join(test_dir, "http", "conf", "webkit-http
d.pem") |
| 67 access_log = self._filesystem.join(output_dir, "access_log.txt") | 66 access_log = self._filesystem.join(output_dir, "access_log.txt") |
| 68 error_log = self._filesystem.join(output_dir, "error_log.txt") | 67 error_log = self._filesystem.join(output_dir, "error_log.txt") |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 # the sake of Window/Cygwin and it needs quoting that breaks | 166 # the sake of Window/Cygwin and it needs quoting that breaks |
| 168 # shell=False. | 167 # shell=False. |
| 169 # FIXME: We should not need to be joining shell arguments into strings. | 168 # FIXME: We should not need to be joining shell arguments into strings. |
| 170 # shell=True is a trail of tears. | 169 # shell=True is a trail of tears. |
| 171 # Note: Not thread safe: http://bugs.python.org/issue2320 | 170 # Note: Not thread safe: http://bugs.python.org/issue2320 |
| 172 process = self._executive.popen(cmd, shell=True, stderr=self._executive.
PIPE) | 171 process = self._executive.popen(cmd, shell=True, stderr=self._executive.
PIPE) |
| 173 process.wait() | 172 process.wait() |
| 174 retval = process.returncode | 173 retval = process.returncode |
| 175 err = process.stderr.read() | 174 err = process.stderr.read() |
| 176 return (retval, err) | 175 return (retval, err) |
| OLD | NEW |