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

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

Issue 3129013: Add an SD card reader test. (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: Rename test to hardware_RealtekCardReader. 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_RealtekCardReader/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_RealtekCardReader/hardware_RealtekCardReader.py
diff --git a/client/site_tests/hardware_RealtekCardReader/hardware_RealtekCardReader.py b/client/site_tests/hardware_RealtekCardReader/hardware_RealtekCardReader.py
new file mode 100644
index 0000000000000000000000000000000000000000..e710f05d38104dabb0bb4152ddf7feb2681e1de7
--- /dev/null
+++ b/client/site_tests/hardware_RealtekCardReader/hardware_RealtekCardReader.py
@@ -0,0 +1,30 @@
+# 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 glob, logging, os
+
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
+
+class hardware_RealtekCardReader(test.test):
+ version = 1
+
+ def run_once(self):
+ # Look for the Realtek USB card reader.
+ # This requires a plugged in SD card.
+ lsusb_output = utils.system_output("lsusb")
+ if not "0bda:0138 Realtek" in lsusb_output:
+ raise error.TestFail("The Realtek card reader USB device was not "
+ "detected. This test requires an SD card to "
+ "be inserted to detect the USB device.")
+
+ blockdevs = glob.glob("/sys/block/*")
+ for dev in blockdevs:
+ removable = utils.read_one_line(os.path.join(dev, "removable"))
+ if removable == "1":
+ logging.info("Found removable block device %s", dev)
+ return True
+
+ raise error.TestFail("The card reader USB device was detected, but "
+ "no removable block devices are seen.")
« no previous file with comments | « client/site_tests/hardware_RealtekCardReader/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698