Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: client/site_tests/hardware_Ath3k/hardware_Ath3k.py

Issue 3157019: Introduce a test for ath3k hardware. (Closed) Base URL: http://src.chromium.org/git/autotest.git
Patch Set: Modiefied to address a review comment. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/hardware_Ath3k/control ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/hardware_Ath3k/hardware_Ath3k.py
diff --git a/client/site_tests/hardware_Ath3k/hardware_Ath3k.py b/client/site_tests/hardware_Ath3k/hardware_Ath3k.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5502466b9e7e7efa37a29f19ae542ce05e5592c
--- /dev/null
+++ b/client/site_tests/hardware_Ath3k/hardware_Ath3k.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging
+
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
+
+
+def usb_device_present(vendor_device):
+ '''Check if lsusb recognizes a certain vendor/device ID combination.
+
+ This should eventually be added to autotest_lib.client.bin.utils.
+ '''
+
+ command = '/usr/sbin/lsusb -d %s' % vendor_device.lower()
+ return utils.run(command).exit_status == 0
+
+
+class hardware_Ath3k(test.test):
+ version = 1
+
+ def run_once(self):
+ device = '0cf3:3002'
+ module = 'ath3k'
+ if not usb_device_present(device):
+ raise error.TestFail('usb device %s not found' % device)
+
+ if not utils.module_is_loaded(module):
+ raise error.TestFail('driver module %s not loaded' % module)
« no previous file with comments | « client/site_tests/hardware_Ath3k/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698