OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import logging |
| 6 |
| 7 from autotest_lib.client.bin import test, utils |
| 8 from autotest_lib.client.common_lib import error |
| 9 |
| 10 |
| 11 def usb_device_present(vendor_device): |
| 12 '''Check if lsusb recognizes a certain vendor/device ID combination. |
| 13 |
| 14 This should eventually be added to autotest_lib.client.bin.utils. |
| 15 ''' |
| 16 |
| 17 command = '/usr/sbin/lsusb -d %s' % vendor_device.lower() |
| 18 return utils.run(command).exit_status == 0 |
| 19 |
| 20 |
| 21 class hardware_Ath3k(test.test): |
| 22 version = 1 |
| 23 |
| 24 def run_once(self): |
| 25 device = '0cf3:3002' |
| 26 module = 'ath3k' |
| 27 if not usb_device_present(device): |
| 28 raise error.TestFail('usb device %s not found' % device) |
| 29 |
| 30 if not utils.module_is_loaded(module): |
| 31 raise error.TestFail('driver module %s not loaded' % module) |
OLD | NEW |