OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS 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 from autotest_lib.client.bin import site_backchannel, test, utils | 5 from autotest_lib.client.bin import test, utils |
6 from autotest_lib.client.common_lib import error | 6 from autotest_lib.client.common_lib import error |
| 7 from autotest_lib.client.cros import backchannel |
7 | 8 |
8 import logging, re, socket, string, time, urllib2 | 9 import logging, re, socket, string, time, urllib2 |
9 import dbus, dbus.mainloop.glib, gobject | 10 import dbus, dbus.mainloop.glib, gobject |
10 | 11 |
11 from autotest_lib.client.cros import flimflam_test_path | 12 from autotest_lib.client.cros import flimflam_test_path |
12 import flimflam, routing, mm | 13 import flimflam, routing, mm |
13 | 14 |
14 SERVER = 'testing-chargen.appspot.com' | 15 SERVER = 'testing-chargen.appspot.com' |
15 BASE_URL = 'http://' + SERVER + '/' | 16 BASE_URL = 'http://' + SERVER + '/' |
16 | 17 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if len(self.GetModemInfo()) != len(modem_info): | 220 if len(self.GetModemInfo()) != len(modem_info): |
220 logging.info('NewInfo: %s' % ', '.join(self.GetModemInfo())) | 221 logging.info('NewInfo: %s' % ', '.join(self.GetModemInfo())) |
221 raise error.TestFail('Test shutdown: ' | 222 raise error.TestFail('Test shutdown: ' |
222 'failed to leave modem in working state.') | 223 'failed to leave modem in working state.') |
223 | 224 |
224 if sleep_kludge: | 225 if sleep_kludge: |
225 logging.info('Sleeping for %.1f seconds', sleep_kludge) | 226 logging.info('Sleeping for %.1f seconds', sleep_kludge) |
226 time.sleep(sleep_kludge) | 227 time.sleep(sleep_kludge) |
227 | 228 |
228 def run_once(self, connect_count=5, sleep_kludge=5): | 229 def run_once(self, connect_count=5, sleep_kludge=5): |
229 site_backchannel.setup() | 230 backchannel.setup() |
230 time.sleep(3) | 231 time.sleep(3) |
231 self.flim = flimflam.FlimFlam() | 232 self.flim = flimflam.FlimFlam() |
232 self.device_manager = flimflam.DeviceManager(self.flim) | 233 self.device_manager = flimflam.DeviceManager(self.flim) |
233 try: | 234 try: |
234 self.device_manager.ShutdownAllExcept('cellular') | 235 self.device_manager.ShutdownAllExcept('cellular') |
235 self.run_once_internal(connect_count, sleep_kludge) | 236 self.run_once_internal(connect_count, sleep_kludge) |
236 finally: | 237 finally: |
237 try: | 238 try: |
238 self.device_manager.RestoreDevices() | 239 self.device_manager.RestoreDevices() |
239 finally: | 240 finally: |
240 site_backchannel.teardown() | 241 backchannel.teardown() |
OLD | NEW |