• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 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.cros.storage_tests import fio_test
6
7class hardware_StorageFio(fio_test.FioTest):
8    """
9    Runs several fio jobs and reports results.
10
11    fio (flexible I/O tester) is an I/O tool for benchmark and stress/hardware
12    verification.
13
14    """
15
16    version = 7
17    DEFAULT_FILE_SIZE = 1024 * 1024 * 1024
18
19    def initialize(self, dev='', filesize=DEFAULT_FILE_SIZE):
20        """
21        Set up local variables.
22
23        @param dev: block device / file to test.
24                Spare partition on root device by default
25        @param filesize: size of the file. 0 means whole partition.
26                by default, 1GB.
27        """
28        super(hardware_StorageFio, self).initialize(dev=dev, filesize=filesize)
29
30    def run_once(self, dev='', quicktest=False, requirements=None,
31                 integrity=False, wait=60 * 60 * 72, blkdiscard=True):
32        """
33        Runs several fio jobs and reports results.
34
35        @param dev: block device to test
36        @param quicktest: short test
37        @param requirements: list of jobs for fio to run
38        @param integrity: test to check data integrity
39        @param wait: seconds to wait between a write and subsequent verify
40        @param blkdiscard: do a blkdiscard before running fio
41
42        """
43        super(hardware_StorageFio, self).run_once(dev=dev, quicktest=quicktest,
44                                                  requirements=requirements,
45                                                  integrity=integrity,
46                                                  wait=wait,
47                                                  blkdiscard=blkdiscard)
48