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_MultiReader(test.test): 11 version = 1 12 13 def run_once(self): 14 blockdev_paths = glob.glob("/sys/block/*/removable") 15 for path in blockdev_paths: 16 removable = utils.read_one_line(path) 17 if removable == "1": 18 logging.info("Found removable block device %s", 19 os.path.dirname(path)) 20 return True 21 22 raise error.TestFail("No removable block devices are seen.") 23