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