- Revision
- 132678
- Author
- [email protected]
- Date
- 2012-10-26 11:41:10 -0700 (Fri, 26 Oct 2012)
Log Message
webkitpy: Pass the `Listen' Apache directive from webkitpy, not the httpd.conf files.
https://bugs.webkit.org/show_bug.cgi?id=98602
Reviewed by Dirk Pranke.
Tools:
Unify all the different `Listen' directives present in the several
httpd.conf files we have in LayoutTests/http/conf. For one, we
were already passing `Listen 127.0.0.1:8000' via webkitpy before,
and opening the other ports from the conf files.
The configuration files differed mostly in the way they handled
IPV6 ports. Some of them did not listen to IPV6 ports because the
systems which used them sometimes did not have IPV6 support. The
`http_server_supports_ipv6' method has been added to Port to
address that. cygwin, on its turn, still seems to use Apache 1.3,
which does not support IPV6 at all; the newly-added method has a
special case for that. Plus, perform a socket.getaddrinfo() call
the same way Apache itself does so we are sure we only enable IPV6
when setting that up in the httpd server is not going to fail.
* Scripts/webkitpy/common/system/platforminfo_mock.py:
(MockPlatformInfo.is_cygwin):
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.baseline_version_dir):
(Port.to.start_websocket_server):
(Port.to):
(Port.to.http_server_supports_ipv6):
* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_http_server_supports_ipv6):
(PortTest.test_build_path):
* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd):
(LayoutTestApacheHttpd.__init__):
LayoutTests:
* http/conf/apache2-debian-httpd.conf: Remove the `Listen'
directive and related comments, it is passed to httpd by webkitpy
now.
* http/conf/apache2-httpd.conf: Ditto.
* http/conf/cygwin-httpd.conf: Ditto.
* http/conf/fedora-httpd.conf: Ditto.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (132677 => 132678)
--- trunk/LayoutTests/ChangeLog 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/LayoutTests/ChangeLog 2012-10-26 18:41:10 UTC (rev 132678)
@@ -1,3 +1,17 @@
+2012-10-26 Raphael Kubo da Costa <[email protected]>
+
+ webkitpy: Pass the `Listen' Apache directive from webkitpy, not the httpd.conf files.
+ https://bugs.webkit.org/show_bug.cgi?id=98602
+
+ Reviewed by Dirk Pranke.
+
+ * http/conf/apache2-debian-httpd.conf: Remove the `Listen'
+ directive and related comments, it is passed to httpd by webkitpy
+ now.
+ * http/conf/apache2-httpd.conf: Ditto.
+ * http/conf/cygwin-httpd.conf: Ditto.
+ * http/conf/fedora-httpd.conf: Ditto.
+
2012-10-26 Simon Fraser <[email protected]>
compositing/tiling/huge-layer* flakey
Modified: trunk/LayoutTests/http/conf/apache2-debian-httpd.conf (132677 => 132678)
--- trunk/LayoutTests/http/conf/apache2-debian-httpd.conf 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/LayoutTests/http/conf/apache2-debian-httpd.conf 2012-10-26 18:41:10 UTC (rev 132678)
@@ -13,24 +13,8 @@
MaxSpareServers 5
StartServers 1
MaxClients 150
-#
MaxRequestsPerChild 100000
-# Configured from the httpd command line for WebKit layout tests.
-# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
-Listen 127.0.0.1:8080
-Listen 127.0.0.1:8443
-# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
-# requests to 8000 from random users on network.
-# See https://bugs.webkit.org/show_bug.cgi?id=37104
-# FIXME: This breaks the GTK-Debug and Chromium-Linux bots.
-# Starting up apache fails on this line with a syntax error.
-# Need a way to detect if the machine supports ipv6 and then
-# only do this binding in that case.
-#Listen [::1]:8000
-#Listen [::1]:8080
-#Listen [::1]:8443
-
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
LoadModule include_module /usr/lib/apache2/modules/mod_include.so
Modified: trunk/LayoutTests/http/conf/apache2-httpd.conf (132677 => 132678)
--- trunk/LayoutTests/http/conf/apache2-httpd.conf 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/LayoutTests/http/conf/apache2-httpd.conf 2012-10-26 18:41:10 UTC (rev 132678)
@@ -15,19 +15,6 @@
MaxClients 150
MaxRequestsPerChild 100000
-# Configured from the httpd command line for WebKit layout tests.
-# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
-#
-#Listen 3000
-Listen 127.0.0.1:8080
-Listen 127.0.0.1:8443
-# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
-# requests to 8000 from random users on network.
-# See https://bugs.webkit.org/show_bug.cgi?id=37104
-Listen [::1]:8000
-Listen [::1]:8080
-Listen [::1]:8443
-
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
Modified: trunk/LayoutTests/http/conf/cygwin-httpd.conf (132677 => 132678)
--- trunk/LayoutTests/http/conf/cygwin-httpd.conf 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/LayoutTests/http/conf/cygwin-httpd.conf 2012-10-26 18:41:10 UTC (rev 132678)
@@ -19,13 +19,6 @@
MaxClients 150
MaxRequestsPerChild 100000
-# Configured from the httpd command line for WebKit layout tests.
-Listen 127.0.0.1:8080
-# Apache 1.3 only supports IPv4, so we do not listen on ::1 (IPv6 loopback).
-# This may cause flaky tests on systems which support IPv6 if localhost resolves
-# to ::1 in addition to 127.0.0.1.
-# See https://bugs.webkit.org/show_bug.cgi?id=37104
-
LoadModule config_log_module lib/apache/mod_log_config.dll
LoadModule mime_module lib/apache/mod_mime.dll
LoadModule negotiation_module lib/apache/mod_negotiation.dll
Modified: trunk/LayoutTests/http/conf/fedora-httpd.conf (132677 => 132678)
--- trunk/LayoutTests/http/conf/fedora-httpd.conf 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/LayoutTests/http/conf/fedora-httpd.conf 2012-10-26 18:41:10 UTC (rev 132678)
@@ -16,15 +16,6 @@
MaxClients 150
MaxRequestsPerChild 100000
-Listen 127.0.0.1:8080
-Listen 127.0.0.1:8443
-# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
-# requests to 8000 from random users on network.
-# See https://bugs.webkit.org/show_bug.cgi?id=37104
-Listen [::1]:8000
-Listen [::1]:8080
-Listen [::1]:8443
-
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
Modified: trunk/Tools/ChangeLog (132677 => 132678)
--- trunk/Tools/ChangeLog 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/Tools/ChangeLog 2012-10-26 18:41:10 UTC (rev 132678)
@@ -1,3 +1,39 @@
+2012-10-26 Raphael Kubo da Costa <[email protected]>
+
+ webkitpy: Pass the `Listen' Apache directive from webkitpy, not the httpd.conf files.
+ https://bugs.webkit.org/show_bug.cgi?id=98602
+
+ Reviewed by Dirk Pranke.
+
+ Unify all the different `Listen' directives present in the several
+ httpd.conf files we have in LayoutTests/http/conf. For one, we
+ were already passing `Listen 127.0.0.1:8000' via webkitpy before,
+ and opening the other ports from the conf files.
+
+ The configuration files differed mostly in the way they handled
+ IPV6 ports. Some of them did not listen to IPV6 ports because the
+ systems which used them sometimes did not have IPV6 support. The
+ `http_server_supports_ipv6' method has been added to Port to
+ address that. cygwin, on its turn, still seems to use Apache 1.3,
+ which does not support IPV6 at all; the newly-added method has a
+ special case for that. Plus, perform a socket.getaddrinfo() call
+ the same way Apache itself does so we are sure we only enable IPV6
+ when setting that up in the httpd server is not going to fail.
+
+ * Scripts/webkitpy/common/system/platforminfo_mock.py:
+ (MockPlatformInfo.is_cygwin):
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.baseline_version_dir):
+ (Port.to.start_websocket_server):
+ (Port.to):
+ (Port.to.http_server_supports_ipv6):
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ (PortTest.test_http_server_supports_ipv6):
+ (PortTest.test_build_path):
+ * Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
+ (LayoutTestApacheHttpd):
+ (LayoutTestApacheHttpd.__init__):
+
2012-10-26 David Barton <[email protected]>
Unreviewed. Update my IRC nickname to a registered one.
Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (132677 => 132678)
--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py 2012-10-26 18:41:10 UTC (rev 132678)
@@ -42,7 +42,7 @@
return self.os_name == 'win'
def is_cygwin(self):
- return False
+ return self.os_name == 'cygwin'
def is_freebsd(self):
return self.os_name == 'freebsd'
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (132677 => 132678)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-10-26 18:41:10 UTC (rev 132678)
@@ -207,7 +207,6 @@
baseline_search_paths = self.baseline_search_path()
return baseline_search_paths[0]
-
def baseline_search_path(self):
return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path()
@@ -924,6 +923,13 @@
server.start()
self._websocket_server = server
+ def http_server_supports_ipv6(self):
+ # Cygwin is the only platform to still use Apache 1.3, which only supports IPV4.
+ # Once it moves to Apache 2, we can drop this method altogether.
+ if self.host.platform.is_cygwin():
+ return False
+ return True
+
def acquire_http_lock(self):
self._http_lock = http_lock.HttpLock(None, filesystem=self._filesystem, executive=self._executive)
self._http_lock.wait_for_httpd_lock()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (132677 => 132678)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-10-26 18:41:10 UTC (rev 132678)
@@ -379,6 +379,14 @@
def test_operating_system(self):
self.assertEqual('mac', self.make_port().operating_system())
+ def test_http_server_supports_ipv6(self):
+ port = self.make_port()
+ self.assertTrue(port.http_server_supports_ipv6())
+ port.host.platform.os_name = 'cygwin'
+ self.assertFalse(port.http_server_supports_ipv6())
+ port.host.platform.os_name = 'win'
+ self.assertTrue(port.http_server_supports_ipv6())
+
def test_check_httpd_success(self):
port = self.make_port(executive=MockExecutive2())
port._path_to_apache = lambda: '/usr/sbin/httpd'
@@ -451,6 +459,5 @@
port = self.make_port(options=optparse.Values({'build_directory': '/my-build-directory/'}))
self.assertEqual(port._build_path(), '/my-build-directory/Release')
-
if __name__ == '__main__':
unittest.main()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py (132677 => 132678)
--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py 2012-10-26 18:18:14 UTC (rev 132677)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py 2012-10-26 18:41:10 UTC (rev 132678)
@@ -33,6 +33,7 @@
import logging
import os
import re
+import socket
import sys
from webkitpy.layout_tests.servers import http_server_base
@@ -42,7 +43,6 @@
class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
-
def __init__(self, port_obj, output_dir, additional_dirs=None, number_of_servers=None):
"""Args:
port_obj: handle to the platform-specific routines
@@ -77,7 +77,6 @@
'-C', "\'DocumentRoot \"%s\"\'" % document_root,
'-c', "\'Alias /js-test-resources \"%s\"'" % js_test_resources_dir,
'-c', "\'Alias /media-resources \"%s\"'" % media_resources_dir,
- '-C', "\'Listen %s\'" % "127.0.0.1:8000",
'-c', "\'TypesConfig \"%s\"\'" % mime_types_path,
'-c', "\'CustomLog \"%s\" common\'" % access_log,
'-c', "\'ErrorLog \"%s\"\'" % error_log,
@@ -85,6 +84,30 @@
'-c', "\'PidFile %s'" % self._pid_file,
'-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
+ # a specific host/port. This allows us to avoid trying to listen to
+ # IPV6 addresses when it fails on Apache. APR itself tries to call
+ # getaddrinfo() again without AI_ADDRCONFIG if the first call fails
+ # with EBADFLAGS, but that is not how it normally fails in our use
+ # cases, so ignore that for now.
+ # See https://bugs.webkit.org/show_bug.cgi?id=98602#c7
+ try:
+ socket.getaddrinfo('::1', 0, 0, 0, 0, socket.AI_ADDRCONFIG)
+ except:
+ enable_ipv6 = False
+
+ for mapping in self._mappings:
+ port = mapping['port']
+
+ start_cmd += ['-C', "\'Listen 127.0.0.1:%d\'" % port]
+
+ # We listen to both IPv4 and IPv6 loop-back addresses, but ignore
+ # requests to 8000 from random users on network.
+ # See https://bugs.webkit.org/show_bug.cgi?id=37104
+ if enable_ipv6:
+ start_cmd += ['-C', "\'Listen [::1]:%d\'" % port]
+
if additional_dirs:
for alias, path in additional_dirs.iteritems():
start_cmd += ['-c', "\'Alias %s \"%s\"\'" % (alias, path),
@@ -98,7 +121,6 @@
'-c', "\'MinSpareServers %d\'" % self._number_of_servers,
'-c', "\'MaxSpareServers %d\'" % self._number_of_servers]
-
stop_cmd = [executable,
'-f', "\"%s\"" % self._get_apache_config_file_path(test_dir, output_dir),
'-c', "\'PidFile %s'" % self._pid_file,