1# Copyright 2016 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. 4import logging 5 6from autotest_lib.client.common_lib import utils 7 8 9AUTHOR = 'garnold' 10NAME = 'brillo_StorageWriteSpeedTest.EmulatorTest' 11TIME = 'SHORT' 12TEST_CATEGORY = 'Functional' 13TEST_TYPE = 'Server' 14ATTRIBUTES = 'suite:brillo-smoke' 15SUITE = 'brillo-smoke' 16 17DOC = """ 18Tests whether a Brillo emulator's storage can be written to faster than 19a minimum speed. 20 21Arg: 22 block_size: The block size in bytes to use when writing to storage. 23 num_blocks: The number of blocks to write. 24 min_speed: The minimum write speed required in bytes per second. 25""" 26 27TEST_ARG_NAMES = ('block_size', 'num_blocks', 'min_speed') 28args_dict = utils.args_to_dict(args) 29 30EMULATOR_MIN_SPEED = 10 * 1024 * 1024 31 32def run(machine): 33 test_args = {'min_speed': EMULATOR_MIN_SPEED} 34 for k,v in args_dict.items(): 35 if k in TEST_ARG_NAMES: 36 test_args[k] = int(v) 37 job.run_test('brillo_StorageWriteSpeedTest', 38 host=hosts.create_host(machine), **test_args) 39 40 41parallel_simple(run, machines) 42