Changeset 90810 in webkit
- Timestamp:
- Jul 12, 2011 1:08:28 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r90806 r90810 1 2011-07-12 Eric Seidel <eric@webkit.org> 2 3 [Qt] NRWT should pick up the right httpd config file 4 https://bugs.webkit.org/show_bug.cgi?id=64086 5 6 Reviewed by Adam Barth. 7 8 Removed this old httpd.conf file (used by Tiger and old linux distros) 9 since no supported WebKit ports use it anymore. 10 11 * http/conf/httpd.conf: Removed. 12 1 13 2011-07-11 Hironori Bono <hbono@chromium.org> 2 14 -
trunk/Tools/ChangeLog
r90806 r90810 1 2011-07-12 Eric Seidel <eric@webkit.org> 2 3 [Qt] NRWT should pick up the right httpd config file 4 https://bugs.webkit.org/show_bug.cgi?id=64086 5 6 Reviewed by Adam Barth. 7 8 This is more fall-out from the Port class inappropriately encapsulating 9 both platform and port knowledge. We need to split out some of this 10 platform knowledge into a separate class which can be better shared 11 between ports. 12 13 The fix was to move all the _path_to_apache_config_file logic down 14 into the WebKitPort baseclass so that all of the ports can find the 15 right apache config file, regardless of what platform they may be running on. 16 17 I did not move this down into base.Port (even though I considered it). 18 Chromium duplicates some of this logic, but since they have separate 19 subclasses for each port-OS combination (e.g. ChromiumMac, ChromiumWin) 20 they wouldn't notice the change. Eventually we'll move this logic 21 out of Port entirely, and then it will be shared by all ports. 22 23 I also cleaned up the http-config logic for ORWT while I was there, 24 although since we're killing that code, I'm happy to revert that part 25 of the change if changing it is viewed as needlessly risky. 26 27 During this cleanup, I noticed that no ports use the "default" httpd.conf 28 which is left over from Mac OS X Tiger (and old linux distros) which used 29 Apache 1.3. I've removed httpd.conf (and associated support in ORWT) since 30 we no longer support any ports which use this httpd.conf. 31 32 * Scripts/webkitperl/httpd.pm: 33 (getHTTPDConfigPathForTestDirectory): 34 * Scripts/webkitpy/layout_tests/port/base.py: 35 * Scripts/webkitpy/layout_tests/port/gtk.py: 36 * Scripts/webkitpy/layout_tests/port/mac.py: 37 * Scripts/webkitpy/layout_tests/port/qt.py: 38 * Scripts/webkitpy/layout_tests/port/webkit.py: 39 * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: 40 * Scripts/webkitpy/layout_tests/port/win.py: 41 * Scripts/webkitpy/layout_tests/servers/apache_http_server.py: 42 1 43 2011-07-11 Hironori Bono <hbono@chromium.org> 2 44 -
trunk/Tools/Scripts/webkitperl/httpd.pm
r88012 r90810 137 137 my ($testDirectory) = @_; 138 138 die "No test directory has been specified." unless ($testDirectory); 139 139 140 my $httpdConfig; 140 141 my $httpdPath = getHTTPDPath(); 142 my $httpdConfDirectory = "$testDirectory/http/conf/"; 143 141 144 if (isCygwin()) { 142 my $windowsConfDirectory = "$testDirectory/http/conf/"; 143 unless (-x "/usr/lib/apache/libphp4.dll") { 144 copy("$windowsConfDirectory/libphp4.dll", "/usr/lib/apache/libphp4.dll"); 145 chmod(0755, "/usr/lib/apache/libphp4.dll"); 145 my $libPHP4DllPath = "/usr/lib/apache/libphp4.dll"; 146 # FIXME: run-webkit-tests should not modify the user's system, especially not in this method! 147 unless (-x $libPHP4DllPath) { 148 copy("$httpdConfDirectory/libphp4.dll", $libPHP4DllPath); 149 chmod(0755, $libPHP4DllPath); 146 150 } 147 $httpdConfig = " $windowsConfDirectory/cygwin-httpd.conf";151 $httpdConfig = "cygwin-httpd.conf"; # This is an apache 1.3 config. 148 152 } elsif (isMsys()) { 149 $httpdConfig = " $testDirectory/http/conf/apache2-msys-httpd.conf";153 $httpdConfig = "apache2-msys-httpd.conf"; 150 154 } elsif (isDebianBased()) { 151 $httpdConfig = " $testDirectory/http/conf/apache2-debian-httpd.conf";155 $httpdConfig = "apache2-debian-httpd.conf"; 152 156 } elsif (isFedoraBased()) { 153 $httpdConfig = " $testDirectory/http/conf/fedora-httpd.conf";157 $httpdConfig = "fedora-httpd.conf"; # This is an apache2 config, despite the name. 154 158 } else { 155 $httpdConfig = "$testDirectory/http/conf/httpd.conf";156 $httpdConfig = " $testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|;157 } 158 return $httpdConfig;159 # All other ports use apache2, so just use our default apache2 config. 160 $httpdConfig = "apache2-httpd.conf"; 161 } 162 return "$httpdConfDirectory/$httpdConfig"; 159 163 } 160 164 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r90796 r90810 74 74 75 75 76 # FIXME: This class should merge with webkitpy.common.config.ports.76 # FIXME: This class should merge with WebKitPort now that Chromium behaves mostly like other webkit ports. 77 77 class Port(object): 78 78 """Abstract class for Port-specific hooks for the layout_test package.""" -
trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
r90786 r90810 68 68 environment['LIBOVERLAY_SCROLLBAR'] = '0' 69 69 environment['WEBKIT_INSPECTOR_PATH'] = self._build_path('Programs/resources/inspector') 70 71 70 return environment 72 73 def _path_to_apache_config_file(self):74 # FIXME: This needs to detect the distribution and change config files.75 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')76 71 77 72 def _path_to_driver(self): … … 90 85 return '/usr/sbin/apache2' 91 86 92 def _path_to_apache_config_file(self):93 if self._is_redhat_based():94 config_name = 'fedora-httpd.conf'95 else:96 config_name = 'apache2-debian-httpd.conf'97 98 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_name)99 100 87 def _path_to_wdiff(self): 101 88 if self._is_redhat_based(): … … 103 90 else: 104 91 return '/usr/bin/wdiff' 105 106 def _is_redhat_based(self):107 return self._filesystem.exists(self._filesystem.join('/etc', 'redhat-release'))108 92 109 93 def _path_to_webcore_library(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py
r90697 r90810 114 114 return self._build_java_test_support() 115 115 116 def _path_to_apache_config_file(self):117 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-httpd.conf')118 119 116 def _path_to_webcore_library(self): 120 117 return self._build_path('WebCore.framework/Versions/A/WebCore') -
trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py
r90543 r90810 64 64 self._name = "-".join(name_components) 65 65 66 def _path_to_apache_config_file(self):67 # FIXME: This needs to detect the distribution and change config files.68 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')69 70 66 def _build_driver(self): 71 67 # The Qt port builds DRT as part of the main build step -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
r90548 r90810 37 37 import os 38 38 import re 39 import sys 39 40 import time 40 41 42 from webkitpy.common.memoized import memoized 41 43 from webkitpy.common.net.buildbot import BuildBot 42 44 from webkitpy.common.system.executive import ScriptError … … 50 52 def __init__(self, **kwargs): 51 53 Port.__init__(self, **kwargs) 52 self._cached_apache_path = None # FIXME: This class should use @memoized instead.53 54 54 55 # FIXME: Disable pixel tests until they are run by default on build.webkit.org. … … 359 360 return 'wdiff' 360 361 362 # FIXME: This does not belong on the port object. 363 @memoized 361 364 def _path_to_apache(self): 362 if not self._cached_apache_path: 363 # The Apache binary path can vary depending on OS and distribution 364 # See http://wiki.apache.org/httpd/DistrosDefaultLayout 365 for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: 366 if self._filesystem.exists(path): 367 self._cached_apache_path = path 368 break 369 370 if not self._cached_apache_path: 371 _log.error("Could not find apache. Not installed or unknown path.") 372 373 return self._cached_apache_path 365 # The Apache binary path can vary depending on OS and distribution 366 # See http://wiki.apache.org/httpd/DistrosDefaultLayout 367 for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: 368 if self._filesystem.exists(path): 369 return path 370 _log.error("Could not find apache. Not installed or unknown path.") 371 return None 372 373 # FIXME: This belongs on some platform abstraction instead of Port. 374 def _is_redhat_based(self): 375 return self._filesystem.exists('/etc/redhat-release') 376 377 def _is_debian_based(self): 378 return self._filesystem.exists('/etc/debian_version') 379 380 # We pass sys_platform into this method to make it easy to unit test. 381 def _apache_config_file_name_for_platform(self, sys_platform): 382 if sys_platform == 'cygwin': 383 return 'cygwin-httpd.conf' # CYGWIN is the only platform to still use Apache 1.3. 384 if sys_platform.startswith('linux'): 385 if self._is_redhat_based(): 386 return 'fedora-httpd.conf' # This is an Apache 2.x config file despite the naming. 387 if self._is_debian_based(): 388 return 'apache2-debian-httpd.conf' 389 # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support). 390 return "apache2-httpd.conf" 391 392 def _path_to_apache_config_file(self): 393 config_file_name = self._apache_config_file_name_for_platform(sys.platform) 394 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name) 374 395 375 396 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
r90448 r90810 147 147 expected_stderr = "MOCK run_command: ['Tools/Scripts/build-webkittestrunner', '--release']\n" 148 148 self.assertFalse(output.assert_outputs(self, port._build_driver, expected_stderr=expected_stderr)) 149 150 def _assert_config_file_for_platform(self, port, platform, config_file): 151 self.assertEquals(port._apache_config_file_name_for_platform(platform), config_file) 152 153 def test_linux_distro_detection(self): 154 port = TestWebKitPort() 155 self.assertFalse(port._is_redhat_based()) 156 self.assertFalse(port._is_debian_based()) 157 158 port._filesystem = MockFileSystem({'/etc/redhat-release': ''}) 159 self.assertTrue(port._is_redhat_based()) 160 self.assertFalse(port._is_debian_based()) 161 162 port._filesystem = MockFileSystem({'/etc/debian_version': ''}) 163 self.assertFalse(port._is_redhat_based()) 164 self.assertTrue(port._is_debian_based()) 165 166 def test_apache_config_file_name_for_platform(self): 167 port = TestWebKitPort() 168 self._assert_config_file_for_platform(port, 'cygwin', 'cygwin-httpd.conf') 169 170 self._assert_config_file_for_platform(port, 'linux2', 'apache2-httpd.conf') 171 self._assert_config_file_for_platform(port, 'linux3', 'apache2-httpd.conf') 172 173 port._is_redhat_based = lambda: True 174 self._assert_config_file_for_platform(port, 'linux2', 'fedora-httpd.conf') 175 176 port = TestWebKitPort() 177 port._is_debian_based = lambda: True 178 self._assert_config_file_for_platform(port, 'linux2', 'apache2-debian-httpd.conf') 179 180 self._assert_config_file_for_platform(port, 'mac', 'apache2-httpd.conf') 181 self._assert_config_file_for_platform(port, 'win32', 'apache2-httpd.conf') # win32 isn't a supported sys.platform. AppleWin/WinCairo/WinCE ports all use cygwin. 182 self._assert_config_file_for_platform(port, 'barf', 'apache2-httpd.conf') 183 184 def test_path_to_apache_config_file(self): 185 port = TestWebKitPort() 186 # Mock out _apache_config_file_name_for_platform to ignore the passed sys.platform value. 187 port._apache_config_file_name_for_platform = lambda platform: 'httpd.conf' 188 self.assertEquals(port._path_to_apache_config_file(), '/mock/LayoutTests/http/conf/httpd.conf') -
trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py
r90697 r90810 58 58 return map(self._webkit_baseline_path, self.FALLBACK_PATHS[self._version]) 59 59 60 def _path_to_apache_config_file(self): 61 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'cygwin-httpd.conf') 60 # FIXME: webkitperl/httpd.pm installs /usr/lib/apache/libphp4.dll on cycwin automatically 61 # as part of running old-run-webkit-tests. That's bad design, but we may need some similar hack. 62 # We might use setup_environ_for_server for such a hack (or modify apache_http_server.py). -
trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py
r90534 r90810 63 63 64 64 test_dir = self._port_obj.layout_tests_dir() 65 js_test_resources_dir = self._cygwin_safe_join(test_dir, "fast", "js", 66 "resources") 65 js_test_resources_dir = self._cygwin_safe_join(test_dir, "fast", "js", "resources") 67 66 media_resources_dir = self._cygwin_safe_join(test_dir, "media") 68 mime_types_path = self._cygwin_safe_join(test_dir, "http", "conf", 69 "mime.types") 70 cert_file = self._cygwin_safe_join(test_dir, "http", "conf", 71 "webkit-httpd.pem") 67 mime_types_path = self._cygwin_safe_join(test_dir, "http", "conf", "mime.types") 68 cert_file = self._cygwin_safe_join(test_dir, "http", "conf", "webkit-httpd.pem") 72 69 access_log = self._cygwin_safe_join(output_dir, "access_log.txt") 73 70 error_log = self._cygwin_safe_join(output_dir, "error_log.txt") … … 100 97 101 98 if self._is_cygwin(): 102 cygbin = self._port_obj._path_from_base('third_party', 'cygwin', 103 'bin') 99 cygbin = self._port_obj._path_from_base('third_party', 'cygwin', 'bin') 104 100 # Not entirely sure why, but from cygwin we need to run the 105 101 # httpd command through bash. … … 127 123 return sys.platform in ("win32", "cygwin") 128 124 125 # FIXME: This is the wrong place to have this method. Perhaps this belongs in filesystem.py? 129 126 def _cygwin_safe_join(self, *parts): 130 """Returns a platform appropriate path."""131 127 path = os.path.join(*parts) 132 128 if self._is_cygwin(): … … 161 157 httpd_config_copy = os.path.join(output_dir, "httpd.conf") 162 158 httpd_conf = self._filesystem.read_text_file(httpd_config) 159 # FIXME: This only works for Chromium. Instead it should use some abstraction on the port object. 163 160 if self._is_cygwin(): 164 161 # This is a gross hack, but it lets us use the upstream .conf file … … 168 165 # file. We have apache/cygwin checked into our tree so 169 166 # people don't have to install it into their cygwin. 170 cygusr = self._port_obj._path_from_base('third_party', 'cygwin', 171 'usr') 172 httpd_conf = httpd_conf.replace('ServerRoot "/usr"', 173 'ServerRoot "%s"' % self._get_cygwin_path(cygusr)) 167 cygusr = self._port_obj._path_from_base('third_party', 'cygwin', 'usr') 168 httpd_conf = httpd_conf.replace('ServerRoot "/usr"', 'ServerRoot "%s"' % self._get_cygwin_path(cygusr)) 174 169 175 170 self._filesystem.write_text_file(httpd_config_copy, httpd_conf)
Note: See TracChangeset
for help on using the changeset viewer.