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

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

Issue 3184017: Add a test for multicard reader support. (Closed) Base URL: http://src.chromium.org/git/autotest.git
Patch Set: Use os.path.dirname instead of a regular expression. 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_MultiReader/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_MultiReader/hardware_MultiReader.py
diff --git a/client/site_tests/hardware_MultiReader/hardware_MultiReader.py b/client/site_tests/hardware_MultiReader/hardware_MultiReader.py
new file mode 100644
index 0000000000000000000000000000000000000000..73bd22e9cbdbe4989062abb08efde91e4a081f2b
--- /dev/null
+++ b/client/site_tests/hardware_MultiReader/hardware_MultiReader.py
@@ -0,0 +1,22 @@
+# 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_MultiReader(test.test):
+ version = 1
+
+ def run_once(self):
+ blockdev_paths = glob.glob("/sys/block/*/removable")
+ for path in blockdev_paths:
+ removable = utils.read_one_line(path)
+ if removable == "1":
+ logging.info("Found removable block device %s",
+ os.path.dirname(path))
+ return True
+
+ raise error.TestFail("No removable block devices are seen.")
« no previous file with comments | « client/site_tests/hardware_MultiReader/control ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698