1 # Copyright (c) 2012 Collabora Ltd. 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 from autotest_lib.client.cros import storage as storage_mod 6 7 NAME = "hardware_Usb30Throughput" 8 AUTHOR = "Cosimo Alfarano <cosimo.alfarano (a] collabora.co.uk>" 9 PURPOSE = "Check that there are no transfer speed downgrade after suspend." 10 CRITERIA = "Fails if transfer rate is below expectations" 11 TIME="SHORT" 12 TEST_CATEGORY = "Functional" 13 TEST_CLASS = "hardware" 14 TEST_TYPE = "client" 15 16 DOC = """Measure transfer rates for a number of times. 17 If any of the transfer rate is below expectation the test fails. 18 19 This test need a high-speed USB 3.0 device connected, with a mountable file 20 system on a single partition. 21 No user should be logged in via GUI to avoid automounter interfere with the 22 test. 23 24 @param measurements: (10) number of times to repeat xfer rate measureaments 25 @param size: (10Mb) the size of the file to transfer for each |measureaments| 26 @param fs_uuid: UUID for USB storage define volume, if auto detection does not 27 work. 28 @param min_speed: (300Mb/sec) a float number for the minimum speed accepted. 29 Any |measureaments| performing below it will make the test fail 30 """ 31 32 storage_filter, args_dict = storage_mod.args_to_storage_dict(args) 33 if not storage_filter: 34 storage_filter = {'bus': 'usb'} 35 measurements = int(args_dict.get('measurements', 10)) 36 size = int(args_dict.get('size', 10)) 37 min_speed = float(args_dict.get('min_speed', 300)) 38 39 job.run_test('hardware_Usb30Throughput', storage_filter=storage_filter, 40 measurements=measurements, size=size, min_speed=min_speed) 41