| 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.cros import backchannel |
| 6 from autotest_lib.client.common_lib import error | 7 from autotest_lib.client.common_lib import error |
| 7 | 8 |
| 8 import logging, time | 9 import logging, time |
| 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, mm | 13 import flimflam, mm |
| 13 | 14 |
| 14 | 15 |
| 15 class network_3GFailedConnect(test.test): | 16 class network_3GFailedConnect(test.test): |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 bus_loop = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) | 63 bus_loop = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) |
| 63 self.bus = dbus.SystemBus(mainloop=bus_loop) | 64 self.bus = dbus.SystemBus(mainloop=bus_loop) |
| 64 | 65 |
| 65 # Get to a good starting state | 66 # Get to a good starting state |
| 66 self.ResetAllModems() | 67 self.ResetAllModems() |
| 67 | 68 |
| 68 for ii in xrange(connect_count): | 69 for ii in xrange(connect_count): |
| 69 self.ConnectTo3GNetwork(config_timeout=15) | 70 self.ConnectTo3GNetwork(config_timeout=15) |
| 70 | 71 |
| 71 def run_once(self, connect_count=4): | 72 def run_once(self, connect_count=4): |
| 72 site_backchannel.setup() | 73 backchannel.setup() |
| 73 self.flim = flimflam.FlimFlam() | 74 self.flim = flimflam.FlimFlam() |
| 74 self.device_manager = flimflam.DeviceManager(self.flim) | 75 self.device_manager = flimflam.DeviceManager(self.flim) |
| 75 try: | 76 try: |
| 76 self.device_manager.ShutdownAllExcept('cellular') | 77 self.device_manager.ShutdownAllExcept('cellular') |
| 77 self.run_once_internal(connect_count) | 78 self.run_once_internal(connect_count) |
| 78 finally: | 79 finally: |
| 79 try: | 80 try: |
| 80 self.device_manager.RestoreDevices() | 81 self.device_manager.RestoreDevices() |
| 81 finally: | 82 finally: |
| 82 site_backchannel.teardown() | 83 backchannel.teardown() |
| OLD | NEW |