]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: add fio requirement V2
authorDmitry Monakhov <dmonakhov@openvz.org>
Wed, 20 Feb 2013 10:42:06 +0000 (10:42 +0000)
committerRich Johnston <rjohnston@sgi.com>
Fri, 1 Mar 2013 16:09:07 +0000 (10:09 -0600)
FIO is very flexible io generator, I would call it IO swiss knife.
Currently we have tons of hardcoded application which reproduces
some predefined scenario. This approach has obvious disadvantages
1) Lack of flexibility: one written it is hard to modify it in future
2) Code base is large, many routines written again and again

At the same time add new fio based test, just add simple INI file.
This greatly simplifies code review. I do believe that some day we will
replace most of hardcoded io binaries with fio.

One who is planning to run $FIO_PROG should first check that system
contains appropriate version which is able to handle jobfile
for example:  _require_fio 286-job.fio

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common.config
common.rc

index 7174127802d0b78631e2a728b6b5fca10775928f..dda4b93b19be25ade0c597efb06399d8ce6c990f 100644 (file)
@@ -160,6 +160,7 @@ export INDENT_PROG="`set_prog_path indent`"
 export XFS_COPY_PROG="`set_prog_path xfs_copy`"
 export FSTRIM_PROG="`set_prog_path fstrim`"
 export DUMPE2FS_PROG="`set_prog_path dumpe2fs`"
+export FIO_PROG="`set_prog_path fio`"
 
 # Generate a comparable xfsprogs version number in the form of
 # major * 10000 + minor * 100 + release
index 2f4a9f40b58572bdd27ca2bf5a964d107c9b34d9..9eadaf5670bd01d34d82d1bc172c3ca09d24505f 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -1780,6 +1780,20 @@ _require_btrfs()
        [ $? -eq 0 ] || _notrun "$BTRFS_UTIL_PROG too old (must support $cmd)"
 }
 
+# Check that fio is present, and it is able to execute given jobfile
+_require_fio()
+{
+       job=$1
+
+       _require_command $FIO_PROG
+       if [ -z "$1" ]; then
+               return 1;
+       fi
+
+       $FIO_PROG --warnings-fatal --showcmd $job >/dev/null 2>&1
+       [ $? -eq 0 ] || _notrun "$FIO_PROG too old"
+}
+
 # Does freeze work on this fs?
 _require_freeze()
 {