diff --git a/tests/fiotest/deps/fio-2.1.7.tar.bz2 b/tests/fiotest/deps/fio-2.1.7.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..97775fac0376b5fb73a227ff2248a6c120fc4221 Binary files /dev/null and b/tests/fiotest/deps/fio-2.1.7.tar.bz2 differ diff --git a/tests/fiotest/deps/fio-mixed.job b/tests/fiotest/deps/fio-mixed.job new file mode 100644 index 0000000000000000000000000000000000000000..debc97ed3704b2c909d48dc4d2158e6bbfac5e14 --- /dev/null +++ b/tests/fiotest/deps/fio-mixed.job @@ -0,0 +1,40 @@ +; fio-mixed.job + +[global] +name=fio-sync +;directory=tmpfiles +rw=randrw +rwmixread=67 +rwmixwrite=33 +bsrange=16K-256K +direct=0 +end_fsync=1 +verify=crc32 +;ioscheduler=x +numjobs=4 + +[file1] +size=100M +ioengine=sync +mem=malloc + +[file2] +stonewall +size=100M +ioengine=aio +mem=shm +iodepth=4 + +[file3] +stonewall +size=100M +ioengine=mmap +mem=mmap +direct=1 + +[file4] +stonewall +size=100M +ioengine=splice +mem=malloc +direct=1 diff --git a/tests/fiotest/fiotest.py b/tests/fiotest/fiotest.py new file mode 100755 index 0000000000000000000000000000000000000000..ad06d9ff215725b939d6e27dc46a24f55f9c779c --- /dev/null +++ b/tests/fiotest/fiotest.py @@ -0,0 +1,65 @@ +#!/usr/bin/python + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# See LICENSE for more details. +# +# Copyright: Red Hat Inc. 2014 +# Author: Ruda Moura +# +# Based on Autotest fio test: +# https://github.com/autotest/autotest-client-tests/tree/master/fio + +import os + +from avocado import test +from avocado import job +from avocado.utils import archive +from avocado.utils import build +from avocado.utils import process + + +class fiotest(test.Test): + + """ + fio is an I/O tool meant to be used both for benchmark and + stress/hardware verification. + + :see: http://freecode.com/projects/fio + """ + + default_params = {'fio_tarball': 'fio-2.1.7.tar.bz2', + 'fio_job': 'fio-mixed.job'} + + def setup(self): + """ + Build 'fio'. + """ + self.cwd = os.getcwd() + tarball_path = self.get_deps_path(self.params.fio_tarball) + archive.extract(tarball_path, self.srcdir) + fio_version = self.params.fio_tarball.split('.tar.')[0] + self.srcdir = os.path.join(self.srcdir, fio_version) + cmd = ('chmod +x %s' % os.path.join(self.srcdir, 'configure')) + process.system(cmd) + build.make(self.srcdir) + + def action(self): + """ + Execute 'fio' with appropriate parameters. + """ + os.chdir(self.srcdir) + cmd = ('./fio %s' % self.get_deps_path(self.params.fio_job)) + process.system(cmd) + os.chdir(self.cwd) + + +if __name__ == "__main__": + job.main()