OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import dbus | 6 import dbus |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import time | 9 import time |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 """ | 127 """ |
128 _ROUTER_CONFIG_FILE = os.path.join(pyauto.PyUITest.DataDir(), | 128 _ROUTER_CONFIG_FILE = os.path.join(pyauto.PyUITest.DataDir(), |
129 'pyauto_private', 'chromeos', 'network', | 129 'pyauto_private', 'chromeos', 'network', |
130 'wifi_testbed_config') | 130 'wifi_testbed_config') |
131 _FLIMFLAM_PATH = 'org.chromium.flimflam' | 131 _FLIMFLAM_PATH = 'org.chromium.flimflam' |
132 | 132 |
133 def setUp(self): | 133 def setUp(self): |
134 # Move ethernet to the end of the flimflam priority list, | 134 # Move ethernet to the end of the flimflam priority list, |
135 # effectively hiding any ssh connections that the | 135 # effectively hiding any ssh connections that the |
136 # test harness might be using and putting wifi ahead. | 136 # test harness might be using and putting wifi ahead. |
137 self.CleanupFlimflamDirsOnChromeOS() | |
Nirnimesh
2012/08/15 22:35:02
Move it before the comment.
| |
137 self._PushServiceOrder('wifi,ethernet') | 138 self._PushServiceOrder('wifi,ethernet') |
138 self._ParseDefaultRoutingTable() | 139 self._ParseDefaultRoutingTable() |
139 pyauto.PyUITest.setUp(self) | 140 pyauto.PyUITest.setUp(self) |
140 self.CleanupFlimflamDirsOnChromeOS() | |
141 self.ForgetAllRememberedNetworks() | 141 self.ForgetAllRememberedNetworks() |
142 self._wifi_power_strip = None | 142 self._wifi_power_strip = None |
143 | 143 |
144 def tearDown(self): | 144 def tearDown(self): |
145 self.ForgetAllRememberedNetworks() | 145 self.ForgetAllRememberedNetworks() |
146 pyauto.PyUITest.tearDown(self) | 146 pyauto.PyUITest.tearDown(self) |
147 self._PopServiceOrder() | 147 self._PopServiceOrder() |
148 if self._wifi_power_strip: | 148 if self._wifi_power_strip: |
149 self._wifi_power_strip.TurnOffUsedRouters() | 149 self._wifi_power_strip.TurnOffUsedRouters() |
150 # Remove the route entry for the power strip. | 150 # Remove the route entry for the power strip. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 else: | 273 else: |
274 service_path = self.GetServicePath(router['ssid']) | 274 service_path = self.GetServicePath(router['ssid']) |
275 assert service_path, 'Service with SSID %s is not present.' % \ | 275 assert service_path, 'Service with SSID %s is not present.' % \ |
276 router['ssid'] | 276 router['ssid'] |
277 | 277 |
278 logging.debug('Connecting to router %s.' % router_name) | 278 logging.debug('Connecting to router %s.' % router_name) |
279 error_string = self.ConnectToWifiNetwork(service_path, | 279 error_string = self.ConnectToWifiNetwork(service_path, |
280 password=passphrase, | 280 password=passphrase, |
281 shared=shared) | 281 shared=shared) |
282 return error_string | 282 return error_string |
OLD | NEW |