Home | History | Annotate | Download | only in brillo_StorageWriteSpeedTest
      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 
      5 from autotest_lib.client.common_lib import utils
      6 
      7 AUTHOR = 'garnold'
      8 NAME = 'brillo_StorageWriteSpeedTest.EmulatorTest'
      9 TIME = 'SHORT'
     10 TEST_CATEGORY = 'Functional'
     11 TEST_TYPE = 'Server'
     12 ATTRIBUTES = 'suite:brillo-smoke'
     13 
     14 DOC = """
     15 Tests whether a Brillo emulator's storage can be written to faster than
     16 a minimum speed.
     17 
     18 Arg:
     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 
     24 TEST_ARG_NAMES = ('block_size', 'num_blocks', 'min_speed')
     25 args_dict = utils.args_to_dict(args)
     26 
     27 EMULATOR_MIN_SPEED = 1 * 1024 * 1024
     28 
     29 def 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 
     38 parallel_simple(run, machines)
     39