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

Side by Side Diff: client/site_tests/hardware_ExternalDrives/control

Issue 3256005: Fix tests that rely on rootdev specifying a real block device. (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 3 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 TIME='MEDIUM' 4 TIME='MEDIUM'
5 AUTHOR = 'The Chromium OS Authors' 5 AUTHOR = 'The Chromium OS Authors'
6 DOC = """ 6 DOC = """
7 External storage test suite. 7 External storage test suite.
8 8
9 Tests external storage (USB flash drive / card reader with SD-card inserted) 9 Tests external storage (USB flash drive / card reader with SD-card inserted)
10 performance using several benchmark tools. 10 performance using several benchmark tools.
11 """ 11 """
12 NAME = 'hardware_ExternalDrives' 12 NAME = 'hardware_ExternalDrives'
13 PURPOSE = 'Benchmark external storage devices.' 13 PURPOSE = 'Benchmark external storage devices.'
14 CRITERIA = 'This test is a benchmark.' 14 CRITERIA = 'This test is a benchmark.'
15 TEST_CLASS = 'hardware' 15 TEST_CLASS = 'hardware'
16 TEST_CATEGORY = 'Performance' 16 TEST_CATEGORY = 'Performance'
17 TEST_TYPE = 'client' 17 TEST_TYPE = 'client'
18 VERSION = '1' 18 VERSION = '1'
19 19
20 import os, re 20 import os, re
21 21
22 from autotest_lib.client.bin import utils 22 from autotest_lib.client.bin import utils
23 from autotest_lib.client.common_lib import error, site_ui 23 from autotest_lib.client.common_lib import error, site_ui
24 24
25 25
26 def find_root_dev(): 26 def find_root_dev():
27 rootdev = utils.system_output('rootdev') 27 rootdev = utils.system_output('rootdev -s -d')
28 return os.path.basename(rootdev[:-1]) 28 return os.path.basename(rootdev)
29 29
30 30
31 def find_all_storage_dev(): 31 def find_all_storage_dev():
32 lssys = utils.run('ls -d /sys/block/sd*') 32 lssys = utils.run('ls -d /sys/block/sd*')
33 devices = lssys.stdout.rsplit('\n') 33 devices = lssys.stdout.rsplit('\n')
34 new_devices = [os.path.basename(d.rstrip()) for d in devices if d] 34 new_devices = [os.path.basename(d.rstrip()) for d in devices if d]
35 return new_devices 35 return new_devices
36 36
37 37
38 num_retry = 3 38 num_retry = 3
(...skipping 13 matching lines...) Expand all
52 if os.path.exists(devpath): 52 if os.path.exists(devpath):
53 job.run_test('hardware_StorageFio', dev=devpath, tag=device) 53 job.run_test('hardware_StorageFio', dev=devpath, tag=device)
54 break 54 break
55 else: 55 else:
56 result = dialog.get_result() 56 result = dialog.get_result()
57 num_retry -= 1; 57 num_retry -= 1;
58 58
59 else: 59 else:
60 raise error.TestError('Unable to find a USB flash drive and a SD-card') 60 raise error.TestError('Unable to find a USB flash drive and a SD-card')
61 61
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698