blob: f3ba2f6bc35cf04ba414a22d7e7f3cf80405ca9d [file] [log] [blame]
# Copyright (c) 2012 Collabora Ltd. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from autotest_lib.client.cros import storage as storage_mod
NAME = "hardware_Usb30Throughput"
AUTHOR = "Cosimo Alfarano <cosimo.alfarano@collabora.co.uk>"
PURPOSE = "Check that there are no transfer speed downgrade after suspend."
CRITERIA = "Fails if transfer rate is below expectations"
TIME="SHORT"
TEST_CATEGORY = "Functional"
TEST_CLASS = "hardware"
TEST_TYPE = "client"
DOC = """Measure transfer rates for a number of times.
If any of the transfer rate is below expectation the test fails.
This test need a high-speed USB 3.0 device connected, with a mountable file
system on a single partition.
No user should be logged in via GUI to avoid automounter interfere with the
test.
@param measurements: (10) number of times to repeat xfer rate measureaments
@param size: (10Mb) the size of the file to transfer for each |measureaments|
@param fs_uuid: UUID for USB storage define volume, if auto detection does not
work.
@param min_read_speed: (300Mb/sec) a float number for the minimum read speed
accepted.
Any |measureaments| performing below it will make the test fail
@param min_write_speed: (300Mb/sec) a float number for the minimum write speed
accepted.
Any |measureaments| performing below it will make the test fail
"""
storage_filter, args_dict = storage_mod.args_to_storage_dict(args)
if not storage_filter:
storage_filter = {'bus': 'usb'}
measurements = int(args_dict.get('measurements', 10))
size = int(args_dict.get('size', 10))
min_read_speed = float(args_dict.get('min_read_speed', 300))
min_write_speed = float(args_dict.get('min_write_speed', 300))
job.run_test('hardware_Usb30Throughput', storage_filter=storage_filter,
measurements=measurements, size=size, min_read_speed=min_read_speed,
min_write_speed=min_write_speed)