Changeset 229469 in webkit
- Timestamp:
- Mar 9, 2018, 10:48:46 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r229468 r229469 1 2018-03-09 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 3 [webkitpy, WinCairo] Launch Apache HTTPD for HTTP Tests. 4 https://bugs.webkit.org/show_bug.cgi?id=183265 5 6 Reviewed by Daniel Bates. 7 8 Launch apache httpd server from python script for WinCairo HTTP LayoutTests. By now, AppleWin uses 9 Cygwin to launch httpd server. This patch enables native Windows to run HTTP LayoutTests by starting 10 and stopping httpd server from the script. 11 12 * http/conf/win-httpd-2.4-php7.conf: Added. 13 For WinCairo from native Windows environment. 14 1 15 2018-03-09 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Tools/ChangeLog
r229461 r229469 1 2018-03-09 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 3 [webkitpy, WinCairo] Launch Apache HTTPD for HTTP Tests. 4 https://bugs.webkit.org/show_bug.cgi?id=183265 5 6 Reviewed by Daniel Bates. 7 8 Launch apache httpd server from python script for WinCairo HTTP LayoutTests. By now, AppleWin uses 9 Cygwin to launch httpd server. This patch enables native Windows to run HTTP LayoutTests by starting 10 and stopping httpd server from the script. 11 12 * Scripts/webkitpy/layout_tests/servers/apache_http_server.py: 13 (LayoutTestApacheHttpd.__init__): 14 (LayoutTestApacheHttpd._copy_apache_config_file): 15 (LayoutTestApacheHttpd): 16 (LayoutTestApacheHttpd.platform): 17 (LayoutTestApacheHttpd._spawn_process): 18 (LayoutTestApacheHttpd._stop_running_server): 19 (LayoutTestApacheHttpd._run): 20 (LayoutTestApacheHttpd._server_error): 21 * Scripts/webkitpy/layout_tests/servers/http_server_base.py: 22 (HttpServerBase.aliases): 23 (HttpServerBase): 24 (HttpServerBase._build_alias_path_pairs): 25 (HttpServerBase._build_alias_path_pairs._make_path): 26 * Scripts/webkitpy/layout_tests/servers/http_server_base_unittest.py: 27 (TestHttpServerBase.test_corrupt_pid_file): 28 (TestHttpServerBase): 29 (TestHttpServerBase.test_build_alias_path_pairs): 30 * Scripts/webkitpy/port/base.py: 31 (Port._apache_config_file_name_for_platform): 32 * Scripts/webkitpy/port/port_testcase.py: 33 (test_apache_config_file_name_for_platform): 34 * Scripts/webkitpy/port/win.py: 35 (WinPort._path_to_apache): 36 (WinCairoPort.default_baseline_search_path): 37 (WinCairoPort): 38 (WinCairoPort.check_httpd): 39 1 40 2018-03-09 Carlos Garcia Campos <cgarcia@igalia.com> 2 41 -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py
r229141 r229469 102 102 '-k', "start"] 103 103 104 for aliasin self.aliases():105 start_cmd.extend(['-c', 'Alias %s "%s"' % (alias [0], alias[1])])104 for (alias, path) in self.aliases(): 105 start_cmd.extend(['-c', 'Alias %s "%s"' % (alias, path)]) 106 106 107 107 if not port_obj.host.platform.is_win(): … … 165 165 self._filesystem.write_text_file(httpd_config_copy, httpd_conf) 166 166 167 if self. _port_obj.host.platform.is_cygwin():167 if self.platform.is_cygwin(): 168 168 # Convert to MSDOS file naming: 169 169 precompiledDrive = re.compile('^/cygdrive/[cC]') … … 174 174 return httpd_config_copy 175 175 176 @property 177 def platform(self): 178 return self._port_obj.host.platform 179 176 180 def _spawn_process(self): 177 181 _log.debug('Starting %s server, cmd="%s"' % (self._name, str(self._start_cmd))) 178 182 retval, err = self._run(self._start_cmd) 179 183 if retval or len(err): 180 raise http_server_base.ServerError('Failed to start %s: %s' % (self._name, err))184 raise self._server_error('Failed to start %s' % self._name, err, retval) 181 185 182 186 # For some reason apache isn't guaranteed to have created the pid file before … … 190 194 # If apache was forcefully killed, the pid file will not have been deleted, so check 191 195 # that the process specified by the pid_file no longer exists before deleting the file. 192 if self._pid and not self. _port_obj.host.platform.is_win() and not self._executive.check_running_pid(self._pid):196 if self._pid and not self.platform.is_win() and not self._executive.check_running_pid(self._pid): 193 197 self._filesystem.remove(self._pid_file) 194 198 return … … 197 201 198 202 # Windows httpd outputs shutdown status in stderr: 199 if self. _port_obj.host.platform.is_win() and not retval and len(err):203 if self.platform.is_win() and not retval and len(err): 200 204 _log.debug('Shutdown: %s' % err) 201 205 err = "" 202 206 203 207 if retval or len(err): 204 raise http_server_base.ServerError('Failed to stop %s: %s' % (self._name, err))208 raise self._server_error('Failed to stop %s' % self._name, err, retval) 205 209 206 210 # For some reason apache isn't guaranteed to have actually stopped after … … 208 212 # pid file to be removed. 209 213 if not self._wait_for_action(lambda: not self._filesystem.exists(self._pid_file)): 210 if self. _port_obj.host.platform.is_win():214 if self.platform.is_win(): 211 215 self._remove_pid_file() 212 216 return … … 220 224 err = process.stderr.read() 221 225 return (retval, err) 226 227 def _server_error(self, message, stderr_output, exit_code): 228 if self.platform.is_win() and exit_code == 720005 and not stderr_output: 229 stderr_output = 'Access is denied. Do you have administrator privilege?' 230 return http_server_base.ServerError('{}: {} (exit code={})'.format(message, stderr_output, exit_code)) -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py
r225733 r229469 165 165 166 166 def aliases(self): 167 """Return path pairs used to define aliases. First item is URL path and second 168 one is actual location in the file system.""" 167 169 json_data = self._filesystem.read_text_file(self._port_obj.path_from_webkit_base("Tools", "Scripts", "webkitpy", "layout_tests", "servers", "aliases.json")) 168 results = [] 169 for item in json.loads(json_data): 170 results.append([item[0], self._port_obj._filesystem.join(self.tests_dir, item[1])]) 171 return results 170 return self._build_alias_path_pairs(json.loads(json_data)) 171 172 def _build_alias_path_pairs(self, data): 173 def _make_path(path): 174 return self._filesystem.join(self.tests_dir, self._filesystem.normpath(path)) 175 return [(alias, _make_path(path)) for (alias, path) in data] 172 176 173 177 def _remove_pid_file(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base_unittest.py
r174136 r229469 57 57 # was actually a real implementation. 58 58 self.assertEqual(host.filesystem.files[server._pid_file], None) 59 60 def test_build_alias_path_pairs(self): 61 host = MockHost() 62 test_port = test.TestPort(host) 63 server = HttpServerBase(test_port) 64 65 data = [ 66 ['/media-resources', 'media'], 67 ['/modern-media-controls', '../Source/WebCore/Modules/modern-media-controls'], 68 ['/resources/testharness.css', 'resources/testharness.css'], 69 ] 70 71 expected = [ 72 ('/media-resources', '/test.checkout/LayoutTests/media'), 73 ('/modern-media-controls', '/test.checkout/LayoutTests/../Source/WebCore/Modules/modern-media-controls'), 74 ('/resources/testharness.css', '/test.checkout/LayoutTests/resources/testharness.css'), 75 ] 76 77 self.assertEqual(server._build_alias_path_pairs(data), expected) -
trunk/Tools/Scripts/webkitpy/port/base.py
r229116 r229469 1251 1251 # We pass sys_platform into this method to make it easy to unit test. 1252 1252 def _apache_config_file_name_for_platform(self, sys_platform): 1253 if sys_platform == 'cygwin' or sys_platform.startswith('win'):1253 if sys_platform == 'cygwin': 1254 1254 return 'apache' + self._apache_version() + '-httpd-win.conf' 1255 if sys_platform == 'win32': 1256 return 'win-httpd-' + self._apache_version() + '-php7.conf' 1255 1257 if sys_platform == 'darwin': 1256 1258 return 'apache' + self._apache_version() + self._darwin_php_version() + '-httpd.conf' -
trunk/Tools/Scripts/webkitpy/port/port_testcase.py
r229380 r229469 630 630 631 631 self._assert_config_file_for_platform(port, 'mac', 'apache2.2-httpd.conf') 632 self._assert_config_file_for_platform(port, 'win32', ' apache2.2-httpd-win.conf') # win32 isn't a supported sys.platform. AppleWin/WinCairo ports all usecygwin.632 self._assert_config_file_for_platform(port, 'win32', 'win-httpd-2.2-php7.conf') # WinCairo uses win32. Only AppleWin port uses cygwin. 633 633 self._assert_config_file_for_platform(port, 'barf', 'apache2.2-httpd.conf') 634 634 -
trunk/Tools/Scripts/webkitpy/port/win.py
r228480 r229469 185 185 186 186 def _path_to_apache(self): 187 httpdPath = os.path.join('C:', 'xampp', 'apache', 'bin', 'httpd.exe') 188 if self._filesystem.exists(httpdPath): 189 return httpdPath 190 _log.error("Could not find apache. Not installed or unknown path.") 187 root = os.environ.get('XAMPP_ROOT', 'C:\\xampp') 188 path = self._filesystem.join(root, 'apache', 'bin', 'httpd.exe') 189 if self._filesystem.exists(path): 190 return path 191 _log.error('Could not find apache in the expected location. (path=%s)' % path) 191 192 return None 192 193 … … 464 465 fallback_names.append('wincairo') 465 466 return map(self._webkit_baseline_path, fallback_names) 467 468 def check_httpd(self): 469 if not super(WinCairoPort, self).check_httpd(): 470 return False 471 472 path = self._path_to_apache() 473 if not path: 474 return False 475 476 # To launch Apache as a daemon, service installation is required. 477 exit_code = self._executive.run_command([path, '-k', 'install', '-T'], return_exit_code=True) 478 # 0=success, 2=already installed, 720005=permission error, etc. 479 if exit_code == 0 or exit_code == 2: 480 return True 481 _log.error('Httpd cannot run as a service. Perhaps you forgot to log in as an adminstrator user? (exit code=%s)' % exit_code) 482 return False
Note:
See TracChangeset
for help on using the changeset viewer.