| 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 | 7 |
| 8 import logging, re, socket, string, time, urllib2 | 8 import logging, re, socket, string, time, urllib2 |
| 9 import dbus, dbus.mainloop.glib, gobject | 9 import dbus, dbus.mainloop.glib, gobject |
| 10 | 10 |
| 11 from autotest_lib.client.cros import flimflam_test_path | 11 from autotest_lib.client.cros import flimflam_test_path |
| 12 import flimflam, mm | 12 import flimflam, mm |
| 13 | 13 |
| 14 class network_3GStressEnable(test.test): | 14 class network_3GStressEnable(test.test): |
| 15 version = 1 | 15 version = 1 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 36 def run_once(self, name='usb', cycles=10, min=1, max=20): | 36 def run_once(self, name='usb', cycles=10, min=1, max=20): |
| 37 flim = flimflam.FlimFlam(dbus.SystemBus()) | 37 flim = flimflam.FlimFlam(dbus.SystemBus()) |
| 38 device = flim.FindElementByNameSubstring('Device', name) | 38 device = flim.FindElementByNameSubstring('Device', name) |
| 39 if device is None: | 39 if device is None: |
| 40 device = flim.FindElementByPropertySubstring('Device', 'Interface', | 40 device = flim.FindElementByPropertySubstring('Device', 'Interface', |
| 41 name) | 41 name) |
| 42 self.SetPowered(device, 0) | 42 self.SetPowered(device, 0) |
| 43 for t in xrange(max, min, -1): | 43 for t in xrange(max, min, -1): |
| 44 for _ in xrange(cycles): | 44 for _ in xrange(cycles): |
| 45 self.test(device, t / 10.0) | 45 self.test(device, t / 10.0) |
| OLD | NEW |