From: Dmitry Monakhov Date: Wed, 20 Feb 2013 10:42:06 +0000 (+0000) Subject: xfstests: add fio requirement V2 X-Git-Tag: v2022.05.01~3540 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b3db6021fc2df4e99c9e098612446f4c86e70766;p=xfstests-dev.git xfstests: add fio requirement V2 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 Reviewed-by: Rich Johnston Signed-off-by: Rich Johnston --- diff --git a/common.config b/common.config index 71741278..dda4b93b 100644 --- a/common.config +++ b/common.config @@ -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 diff --git a/common.rc b/common.rc index 2f4a9f40..9eadaf56 100644 --- 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() {