Title: [130083] trunk/Tools
- Revision
- 130083
- Author
- rak...@webkit.org
- Date
- 2012-10-01 15:22:00 -0700 (Mon, 01 Oct 2012)
Log Message
webkitpy should accept a different httpd.conf specified by the user
https://bugs.webkit.org/show_bug.cgi?id=98071
Reviewed by Dirk Pranke.
The existing httpd.conf variants (or lighttpd.conf, for that
matter) we have do not always suit the user's system. This is
particularly true on Linux/Unix, where Apache can be installed in
a plethora of ways and the LoadModule calls can fail to specify
the proper module paths.
For now, we start accepting the WEBKIT_HTTP_SERVER_CONF_PATH
environment variable, which allows the user to specify the
absolute path to another http server configuration file that might
work on the user's system.
In the long term, we should try to generate our configuration file
and stop requiring all the different httpd.conf files we have as
well as this hack.
* Scripts/webkitpy/layout_tests/port/base.py:
(Port._path_to_apache_config_file):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
(test_path_to_apache_config_file):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (130082 => 130083)
--- trunk/Tools/ChangeLog 2012-10-01 22:18:28 UTC (rev 130082)
+++ trunk/Tools/ChangeLog 2012-10-01 22:22:00 UTC (rev 130083)
@@ -1,3 +1,30 @@
+2012-10-01 Raphael Kubo da Costa <raphael.kubo.da.co...@intel.com>
+
+ webkitpy should accept a different httpd.conf specified by the user
+ https://bugs.webkit.org/show_bug.cgi?id=98071
+
+ Reviewed by Dirk Pranke.
+
+ The existing httpd.conf variants (or lighttpd.conf, for that
+ matter) we have do not always suit the user's system. This is
+ particularly true on Linux/Unix, where Apache can be installed in
+ a plethora of ways and the LoadModule calls can fail to specify
+ the proper module paths.
+
+ For now, we start accepting the WEBKIT_HTTP_SERVER_CONF_PATH
+ environment variable, which allows the user to specify the
+ absolute path to another http server configuration file that might
+ work on the user's system.
+
+ In the long term, we should try to generate our configuration file
+ and stop requiring all the different httpd.conf files we have as
+ well as this hack.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port._path_to_apache_config_file):
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ (test_path_to_apache_config_file):
+
2012-10-01 Emil A Eklund <e...@chromium.org>
Unreviewed, upgrade eae to reviewer.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (130082 => 130083)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-10-01 22:18:28 UTC (rev 130082)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-10-01 22:22:00 UTC (rev 130083)
@@ -1165,9 +1165,18 @@
return "apache2-httpd.conf"
def _path_to_apache_config_file(self):
- """Returns the full path to the apache binary.
+ """Returns the full path to the apache configuration file.
+ If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its
+ contents will be used instead.
+
This is needed only by ports that use the apache_http_server module."""
+ config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH')
+ if config_file_from_env:
+ if not self._filesystem.exists(config_file_from_env):
+ raise IOError('%s was not found on the system' % config_file_from_env)
+ return config_file_from_env
+
config_file_name = self._apache_config_file_name_for_platform(sys.platform)
return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py (130082 => 130083)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py 2012-10-01 22:18:28 UTC (rev 130082)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py 2012-10-01 22:22:00 UTC (rev 130083)
@@ -30,6 +30,7 @@
import errno
import logging
+import os
import socket
import sys
import time
@@ -582,10 +583,29 @@
def test_path_to_apache_config_file(self):
port = TestWebKitPort()
+
+ saved_environ = os.environ.copy()
+ try:
+ os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/path/to/httpd.conf'
+ self.assertRaises(IOError, port._path_to_apache_config_file)
+ port._filesystem.write_text_file('/existing/httpd.conf', 'Hello, world!')
+ os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf'
+ self.assertEquals(port._path_to_apache_config_file(), '/existing/httpd.conf')
+ finally:
+ os.environ = saved_environ.copy()
+
# Mock out _apache_config_file_name_for_platform to ignore the passed sys.platform value.
port._apache_config_file_name_for_platform = lambda platform: 'httpd.conf'
self.assertEquals(port._path_to_apache_config_file(), '/mock-checkout/LayoutTests/http/conf/httpd.conf')
+ # Check that even if we mock out _apache_config_file_name, the environment variable takes precedence.
+ saved_environ = os.environ.copy()
+ try:
+ os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf'
+ self.assertEquals(port._path_to_apache_config_file(), '/existing/httpd.conf')
+ finally:
+ os.environ = saved_environ.copy()
+
def test_check_build(self):
port = self.make_port(options=MockOptions(build=True))
self.build_called = False
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes