Commit 560f96f1 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

Blink LayoutTests: Add support for Fedora.

Recent versions of Fedora ship with PHP7, so the Apache configuration
flavors for RedHat don't work on Fedora. Given that Fedora tends to
change a lot quicker than RedHat, it makes sense to have a separate
Apache configuration flavor that can be adapted to changes without
worrying about breaking RedHat support.

Tested by running third_party/WebKit/Tools/Script/run-blink-httpd and
by running some LayoutTests.

Bug: 
Change-Id: I0e468e99832498ad426e1e97852bd4927c874483
Reviewed-on: https://chromium-review.googlesource.com/818644Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523622}
parent 652d384e
ServerTokens Prod
ServerRoot "/etc/httpd"
PidFile "/tmp/WebKit/httpd.pid"
ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
Timeout 300
KeepAlive On
# Setting this value too low may change header size sometimes making flakey tests.
MaxKeepAliveRequests 0
KeepAliveTimeout 9999
MinSpareServers 1
MaxSpareServers 5
StartServers 1
MaxClients 150
MaxRequestsPerChild 100000
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule authz_core_module modules/mod_authz_core.so
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
LoadModule headers_module modules/mod_headers.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule mime_module modules/mod_mime.so
LoadModule asis_module modules/mod_asis.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule env_module modules/mod_env.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
Include /etc/httpd/conf.modules.d/*php*.conf
LoadModule autoindex_module modules/mod_autoindex.so
User apache
Group apache
ServerAdmin root@localhost
ServerName 127.0.0.1
UseCanonicalName On
<Directory />
Options Indexes FollowSymLinks MultiViews ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
Require all denied
</Files>
TypesConfig /etc/mime.types
HostnameLookups Off
PassEnv TMPDIR
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
ServerSignature On
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8
<IfModule mod_negotiation.c>
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
</IfModule>
AddType application/x-tar .tgz
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddHandler cgi-script .cgi .pl
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddHandler send-as-is asis
AddType application/x-httpd-php .php
AddType application/x-httpd-php .bat
AddType application/x-httpd-php-source .phps
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
php_flag log_errors on
php_flag short_open_tag on
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
<VirtualHost *:8443>
ServerName 127.0.0.1
SSLEngine On
</VirtualHost>
#
# Apple-specific filesystem protection.
#
<Files "rsrc">
Require all denied
</Files>
<Directory ~ ".*\.\.namedfork">
Require all denied
</Directory>
......@@ -122,6 +122,9 @@ class PlatformInfo(object):
if not self.is_linux():
return None
# Fedora also has /etc/redhat-release, this check must go first.
if self._filesystem.exists('/etc/fedora-release'):
return 'fedora'
if self._filesystem.exists('/etc/redhat-release'):
return 'redhat'
if self._filesystem.exists('/etc/debian_version'):
......
......@@ -168,15 +168,18 @@ class TestPlatformInfo(unittest.TestCase):
with self.assertRaises(AssertionError):
self.make_info(fake_sys('win32'), executive=fake_executive('6.1.1234'))
def _assert_file_implies_linux_distribution(self, file_path, distribution):
info = self.make_info(sys_module=fake_sys('linux2'), filesystem_module=MockFileSystem({file_path: ''}))
def _assert_files_imply_linux_distribution(self, file_paths, distribution):
fs_module = MockFileSystem({file_path: '' for file_path in file_paths})
info = self.make_info(sys_module=fake_sys('linux2'), filesystem_module=fs_module)
self.assertEqual(info.linux_distribution(), distribution)
def test_linux_distro_detection(self):
self._assert_file_implies_linux_distribution('/etc/arch-release', 'arch')
self._assert_file_implies_linux_distribution('/etc/debian_version', 'debian')
self._assert_file_implies_linux_distribution('/etc/redhat-release', 'redhat')
self._assert_file_implies_linux_distribution('/etc/mock-release', 'unknown')
self._assert_files_imply_linux_distribution(['/etc/arch-release'], 'arch')
self._assert_files_imply_linux_distribution(['/etc/debian_version'], 'debian')
self._assert_files_imply_linux_distribution(['/etc/fedora-release'], 'fedora')
self._assert_files_imply_linux_distribution(['/etc/fedora-release', '/etc/redhat-release'], 'fedora')
self._assert_files_imply_linux_distribution(['/etc/redhat-release'], 'redhat')
self._assert_files_imply_linux_distribution(['/etc/mock-release'], 'unknown')
def test_display_name(self):
info = self.make_info(fake_sys('darwin'))
......
......@@ -1483,8 +1483,8 @@ class Port(object):
if self.host.platform.is_linux():
distribution = self.host.platform.linux_distribution()
custom_configuration_distributions = ['arch', 'debian', 'redhat']
if distribution in custom_configuration_distributions:
custom_configurations = ['arch', 'debian', 'fedora', 'redhat']
if distribution in custom_configurations:
return '%s-httpd-%s.conf' % (distribution, self._apache_version())
return 'apache2-httpd-' + self._apache_version() + '.conf'
......
......@@ -808,6 +808,7 @@ class PortTest(unittest.TestCase):
self._assert_config_file_for_platform(port, 'linux', 'apache2-httpd-2.2.conf')
self._assert_config_file_for_linux_distribution(port, 'arch', 'arch-httpd-2.2.conf')
self._assert_config_file_for_linux_distribution(port, 'debian', 'debian-httpd-2.2.conf')
self._assert_config_file_for_linux_distribution(port, 'fedora', 'fedora-httpd-2.2.conf')
self._assert_config_file_for_linux_distribution(port, 'slackware', 'apache2-httpd-2.2.conf')
self._assert_config_file_for_linux_distribution(port, 'redhat', 'redhat-httpd-2.2.conf')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment