1# Lint as: python2, python3 2# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6from autotest_lib.client.cros.storage_tests import fio_test 7 8class hardware_StorageFio(fio_test.FioTest): 9 """ 10 Runs several fio jobs and reports results. 11 12 fio (flexible I/O tester) is an I/O tool for benchmark and stress/hardware 13 verification. 14 15 """ 16 17 version = 7 18 DEFAULT_FILE_SIZE = 1024 * 1024 * 1024 19 20 def initialize(self, dev='', filesize=DEFAULT_FILE_SIZE): 21 """ 22 Set up local variables. 23 24 @param dev: block device / file to test. 25 Spare partition on root device by default 26 @param filesize: size of the file. 0 means whole partition. 27 by default, 1GB. 28 """ 29 super(hardware_StorageFio, self).initialize(dev=dev, filesize=filesize) 30 31 def run_once(self, dev='', quicktest=False, requirements=None, 32 integrity=False, wait=60 * 60 * 72, blkdiscard=True): 33 """ 34 Runs several fio jobs and reports results. 35 36 @param dev: block device to test 37 @param quicktest: short test 38 @param requirements: list of jobs for fio to run 39 @param integrity: test to check data integrity 40 @param wait: seconds to wait between a write and subsequent verify 41 @param blkdiscard: do a blkdiscard before running fio 42 43 """ 44 super(hardware_StorageFio, self).run_once(dev=dev, quicktest=quicktest, 45 requirements=requirements, 46 integrity=integrity, 47 wait=wait, 48 blkdiscard=blkdiscard) 49