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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « client/site_tests/hardware_RealtekCardReader/control ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 glob, logging, os
6
7 from autotest_lib.client.bin import test, utils
8 from autotest_lib.client.common_lib import error
9
10 class hardware_RealtekCardReader(test.test):
11 version = 1
12
13 def run_once(self):
14 # Look for the Realtek USB card reader.
15 # This requires a plugged in SD card.
16 lsusb_output = utils.system_output("lsusb")
17 if not "0bda:0138 Realtek" in lsusb_output:
18 raise error.TestFail("The Realtek card reader USB device was not "
19 "detected. This test requires an SD card to "
20 "be inserted to detect the USB device.")
21
22 blockdevs = glob.glob("/sys/block/*")
23 for dev in blockdevs:
24 removable = utils.read_one_line(os.path.join(dev, "removable"))
25 if removable == "1":
26 logging.info("Found removable block device %s", dev)
27 return True
28
29 raise error.TestFail("The card reader USB device was detected, but "
30 "no removable block devices are seen.")
OLDNEW
« 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