Changeset 130083 in webkit


Ignore:
Timestamp:
Oct 1, 2012, 3:22:00 PM (13 years ago)
Author:
rakuco@webkit.org
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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r130078 r130083  
     12012-10-01  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
     2
     3        webkitpy should accept a different httpd.conf specified by the user
     4        https://bugs.webkit.org/show_bug.cgi?id=98071
     5
     6        Reviewed by Dirk Pranke.
     7
     8        The existing httpd.conf variants (or lighttpd.conf, for that
     9        matter) we have do not always suit the user's system. This is
     10        particularly true on Linux/Unix, where Apache can be installed in
     11        a plethora of ways and the LoadModule calls can fail to specify
     12        the proper module paths.
     13
     14        For now, we start accepting the WEBKIT_HTTP_SERVER_CONF_PATH
     15        environment variable, which allows the user to specify the
     16        absolute path to another http server configuration file that might
     17        work on the user's system.
     18
     19        In the long term, we should try to generate our configuration file
     20        and stop requiring all the different httpd.conf files we have as
     21        well as this hack.
     22
     23        * Scripts/webkitpy/layout_tests/port/base.py:
     24        (Port._path_to_apache_config_file):
     25        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
     26        (test_path_to_apache_config_file):
     27
    1282012-10-01  Emil A Eklund  <eae@chromium.org>
    229
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r130065 r130083  
    11661166
    11671167    def _path_to_apache_config_file(self):
    1168         """Returns the full path to the apache binary.
     1168        """Returns the full path to the apache configuration file.
     1169
     1170        If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its
     1171        contents will be used instead.
    11691172
    11701173        This is needed only by ports that use the apache_http_server module."""
     1174        config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH')
     1175        if config_file_from_env:
     1176            if not self._filesystem.exists(config_file_from_env):
     1177                raise IOError('%s was not found on the system' % config_file_from_env)
     1178            return config_file_from_env
     1179
    11711180        config_file_name = self._apache_config_file_name_for_platform(sys.platform)
    11721181        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_file_name)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py

    r129047 r130083  
    3131import errno
    3232import logging
     33import os
    3334import socket
    3435import sys
     
    583584    def test_path_to_apache_config_file(self):
    584585        port = TestWebKitPort()
     586
     587        saved_environ = os.environ.copy()
     588        try:
     589            os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/path/to/httpd.conf'
     590            self.assertRaises(IOError, port._path_to_apache_config_file)
     591            port._filesystem.write_text_file('/existing/httpd.conf', 'Hello, world!')
     592            os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf'
     593            self.assertEquals(port._path_to_apache_config_file(), '/existing/httpd.conf')
     594        finally:
     595            os.environ = saved_environ.copy()
     596
    585597        # Mock out _apache_config_file_name_for_platform to ignore the passed sys.platform value.
    586598        port._apache_config_file_name_for_platform = lambda platform: 'httpd.conf'
    587599        self.assertEquals(port._path_to_apache_config_file(), '/mock-checkout/LayoutTests/http/conf/httpd.conf')
     600
     601        # Check that even if we mock out _apache_config_file_name, the environment variable takes precedence.
     602        saved_environ = os.environ.copy()
     603        try:
     604            os.environ['WEBKIT_HTTP_SERVER_CONF_PATH'] = '/existing/httpd.conf'
     605            self.assertEquals(port._path_to_apache_config_file(), '/existing/httpd.conf')
     606        finally:
     607            os.environ = saved_environ.copy()
    588608
    589609    def test_check_build(self):
Note: See TracChangeset for help on using the changeset viewer.