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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 # The Apache binary path can vary depending on OS and distribution | 97 # The Apache binary path can vary depending on OS and distribution |
98 # See http://wiki.apache.org/httpd/DistrosDefaultLayout | 98 # See http://wiki.apache.org/httpd/DistrosDefaultLayout |
99 for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: | 99 for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]: |
100 if self._filesystem.exists(path): | 100 if self._filesystem.exists(path): |
101 return path | 101 return path |
102 _log.error("Could not find apache. Not installed or unknown path.") | 102 _log.error("Could not find apache. Not installed or unknown path.") |
103 return None | 103 return None |
104 | 104 |
105 def setup_test_run(self): | 105 def setup_test_run(self): |
106 super(LinuxPort, self).setup_test_run() | 106 super(LinuxPort, self).setup_test_run() |
107 self._setup_dummy_home_dir() | 107 #self._setup_dummy_home_dir() |
108 | 108 |
109 def clean_up_test_run(self): | 109 def clean_up_test_run(self): |
110 super(LinuxPort, self).clean_up_test_run() | 110 super(LinuxPort, self).clean_up_test_run() |
111 self._clean_up_dummy_home_dir() | 111 #self._clean_up_dummy_home_dir() |
112 | 112 |
113 # | 113 # |
114 # PROTECTED METHODS | 114 # PROTECTED METHODS |
115 # | 115 # |
116 | 116 |
117 def _setup_dummy_home_dir(self): | 117 def _setup_dummy_home_dir(self): |
118 """Creates a dummy home directory for running the test. | 118 """Creates a dummy home directory for running the test. |
119 | 119 |
120 This is a workaround for crbug.com/595504; see crbug.com/612730. | 120 This is a workaround for crbug.com/595504; see crbug.com/612730. |
121 If crbug.com/612730 is resolved in another way, then this may be | 121 If crbug.com/612730 is resolved in another way, then this may be |
(...skipping 16 matching lines...) Expand all Loading... |
138 def _clean_up_dummy_home_dir(self): | 138 def _clean_up_dummy_home_dir(self): |
139 """Cleans up the dummy dir and resets the HOME environment variable.""" | 139 """Cleans up the dummy dir and resets the HOME environment variable.""" |
140 dummy_home = self.host.environ['HOME'] | 140 dummy_home = self.host.environ['HOME'] |
141 assert dummy_home != self._original_home | 141 assert dummy_home != self._original_home |
142 self._filesystem.rmtree(dummy_home) | 142 self._filesystem.rmtree(dummy_home) |
143 self.host.environ['HOME'] = self._original_home | 143 self.host.environ['HOME'] = self._original_home |
144 | 144 |
145 def _path_to_driver(self, target=None): | 145 def _path_to_driver(self, target=None): |
146 binary_name = self.driver_name() | 146 binary_name = self.driver_name() |
147 return self._build_path_with_target(target, binary_name) | 147 return self._build_path_with_target(target, binary_name) |
OLD | NEW |