Title: [130596] trunk
Revision
130596
Author
[email protected]
Date
2012-10-07 06:19:33 -0700 (Sun, 07 Oct 2012)

Log Message

webkitpy: Pass the `Listen' Apache directive from Apache, not the httpd.conf files.
https://bugs.webkit.org/show_bug.cgi?id=98602

Reviewed by Eric Seidel.

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.

* 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 (130595 => 130596)


--- trunk/LayoutTests/ChangeLog	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/LayoutTests/ChangeLog	2012-10-07 13:19:33 UTC (rev 130596)
@@ -1,3 +1,17 @@
+2012-10-07  Raphael Kubo da Costa  <[email protected]>
+
+        webkitpy: Pass the `Listen' Apache directive from Apache, not the httpd.conf files.
+        https://bugs.webkit.org/show_bug.cgi?id=98602
+
+        Reviewed by Eric Seidel.
+
+        * 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-07  Christophe Dumez  <[email protected]>
 
         [EFL] Skip css3/masking tests added in r130592

Modified: trunk/LayoutTests/http/conf/apache2-debian-httpd.conf (130595 => 130596)


--- trunk/LayoutTests/http/conf/apache2-debian-httpd.conf	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/LayoutTests/http/conf/apache2-debian-httpd.conf	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/LayoutTests/http/conf/apache2-httpd.conf	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/LayoutTests/http/conf/apache2-httpd.conf	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/LayoutTests/http/conf/cygwin-httpd.conf	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/LayoutTests/http/conf/cygwin-httpd.conf	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/LayoutTests/http/conf/fedora-httpd.conf	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/LayoutTests/http/conf/fedora-httpd.conf	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/Tools/ChangeLog	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/Tools/ChangeLog	2012-10-07 13:19:33 UTC (rev 130596)
@@ -1,3 +1,37 @@
+2012-10-07  Raphael Kubo da Costa  <[email protected]>
+
+        webkitpy: Pass the `Listen' Apache directive from Apache, not the httpd.conf files.
+        https://bugs.webkit.org/show_bug.cgi?id=98602
+
+        Reviewed by Eric Seidel.
+
+        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.
+
+        * 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-05  Simon Fraser  <[email protected]>
 
         Attempt to fix the SnowLeopard build to making the implementation of

Modified: trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py (130595 => 130596)


--- trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/Tools/Scripts/webkitpy/common/system/platforminfo_mock.py	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2012-10-07 13:19:33 UTC (rev 130596)
@@ -39,6 +39,7 @@
 import operator
 import optparse
 import re
+import socket
 import sys
 
 try:
@@ -203,7 +204,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()
 
@@ -923,6 +923,12 @@
         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.
+        if self.host.platform.is_cygwin():
+            return False
+        return socket.has_ipv6
+
     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 (130595 => 130596)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py	2012-10-07 13:19:33 UTC (rev 130596)
@@ -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 (130595 => 130596)


--- trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py	2012-10-07 13:17:25 UTC (rev 130595)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py	2012-10-07 13:19:33 UTC (rev 130596)
@@ -42,7 +42,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 +76,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 +83,16 @@
             '-c', "\'PidFile %s'" % self._pid_file,
             '-k', "start"]
 
+        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 self._port_obj.http_server_supports_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 +106,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,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to