OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its | 1434 If the WEBKIT_HTTP_SERVER_CONF_PATH environment variable is set, its |
1435 contents will be used instead. | 1435 contents will be used instead. |
1436 | 1436 |
1437 This is needed only by ports that use the apache_http_server module.""" | 1437 This is needed only by ports that use the apache_http_server module.""" |
1438 config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH') | 1438 config_file_from_env = os.environ.get('WEBKIT_HTTP_SERVER_CONF_PATH') |
1439 if config_file_from_env: | 1439 if config_file_from_env: |
1440 if not self._filesystem.exists(config_file_from_env): | 1440 if not self._filesystem.exists(config_file_from_env): |
1441 raise IOError('%s was not found on the system' % config_file_fro
m_env) | 1441 raise IOError('%s was not found on the system' % config_file_fro
m_env) |
1442 return config_file_from_env | 1442 return config_file_from_env |
1443 | 1443 |
1444 config_file_name = self._apache_config_file_name_for_platform(sys.platfo
rm) | 1444 config_file_name = self._apache_config_file_name_for_platform() |
1445 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', co
nfig_file_name) | 1445 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', co
nfig_file_name) |
1446 | 1446 |
1447 # | 1447 # |
1448 # PROTECTED ROUTINES | 1448 # PROTECTED ROUTINES |
1449 # | 1449 # |
1450 # The routines below should only be called by routines in this class | 1450 # The routines below should only be called by routines in this class |
1451 # or any of its subclasses. | 1451 # or any of its subclasses. |
1452 # | 1452 # |
1453 | 1453 |
1454 # FIXME: This belongs on some platform abstraction instead of Port. | |
1455 def _is_redhat_based(self): | |
1456 return self._filesystem.exists('/etc/redhat-release') | |
1457 | |
1458 def _is_debian_based(self): | |
1459 return self._filesystem.exists('/etc/debian_version') | |
1460 | |
1461 def _apache_version(self): | 1454 def _apache_version(self): |
1462 config = self._executive.run_command([self.path_to_apache(), '-v']) | 1455 config = self._executive.run_command([self.path_to_apache(), '-v']) |
1463 return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'
\1', config) | 1456 return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'
\1', config) |
1464 | 1457 |
1465 # We pass sys_platform into this method to make it easy to unit test. | 1458 def _apache_config_file_name_for_platform(self): |
1466 def _apache_config_file_name_for_platform(self, sys_platform): | 1459 if self.host.platform.is_cygwin(): |
1467 if sys_platform == 'cygwin': | |
1468 return 'cygwin-httpd.conf' # CYGWIN is the only platform to still u
se Apache 1.3. | 1460 return 'cygwin-httpd.conf' # CYGWIN is the only platform to still u
se Apache 1.3. |
1469 if sys_platform.startswith('linux'): | 1461 if self.host.platform.is_linux(): |
1470 if self._is_redhat_based(): | 1462 distribution = self.host.platform.linux_distribution() |
1471 return 'fedora-httpd-' + self._apache_version() + '.conf' | 1463 |
1472 if self._is_debian_based(): | 1464 custom_configuration_distributions = ['arch', 'debian', 'redhat'] |
1473 return 'debian-httpd-' + self._apache_version() + '.conf' | 1465 if distribution in custom_configuration_distributions: |
1474 # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and pr
ior, which we no longer support). | 1466 return "%s-httpd-%s.conf" % (distribution, self._apache_version(
)) |
| 1467 |
1475 return 'apache2-httpd-' + self._apache_version() + '.conf' | 1468 return 'apache2-httpd-' + self._apache_version() + '.conf' |
1476 | 1469 |
1477 def _path_to_driver(self, configuration=None): | 1470 def _path_to_driver(self, configuration=None): |
1478 """Returns the full path to the test driver.""" | 1471 """Returns the full path to the test driver.""" |
1479 return self._build_path(self.driver_name()) | 1472 return self._build_path(self.driver_name()) |
1480 | 1473 |
1481 def _path_to_webcore_library(self): | 1474 def _path_to_webcore_library(self): |
1482 """Returns the full path to a built copy of WebCore.""" | 1475 """Returns the full path to a built copy of WebCore.""" |
1483 return None | 1476 return None |
1484 | 1477 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 class PhysicalTestSuite(object): | 1762 class PhysicalTestSuite(object): |
1770 def __init__(self, base, args, reference_args=None): | 1763 def __init__(self, base, args, reference_args=None): |
1771 self.name = base | 1764 self.name = base |
1772 self.base = base | 1765 self.base = base |
1773 self.args = args | 1766 self.args = args |
1774 self.reference_args = args if reference_args is None else reference_args | 1767 self.reference_args = args if reference_args is None else reference_args |
1775 self.tests = set() | 1768 self.tests = set() |
1776 | 1769 |
1777 def __repr__(self): | 1770 def __repr__(self): |
1778 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) | 1771 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) |
OLD | NEW |