Whamcloud - gitweb
LU-8721 tests: add parallel-scale fio test 26/23226/4
authorElena Gryaznova <elena.gryaznova@seagate.com>
Thu, 25 May 2017 14:59:28 +0000 (17:59 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 16 Oct 2017 03:21:16 +0000 (03:21 +0000)
Patch adds parallel-scale fio test.

Fio (https://git.kernel.org/pub/scm/linux/kernel/git/axboe/fio.git)
is a flexible generator of I/O of various modes: memory mapped,
multithreaded, asynchronous read/write I/O, etc.
Any fio job file including those created by third party can be
supplied via $fio_jobFile.
By default, random 128mb write
is performed.

Test-Parameters: trivial envdefinitions=ONLY=fio testlist=parallel-scale
Seagate-bug-id: MRP-3707
Signed-off-by: Elena Gryaznova <elena.gryaznova@seagate.com>
Reviewed-by: Vladimir Saveliev <vladimir.saveliev@seagate.com>
Reviewed-by: Alexander Lezhoev <alexander.lezhoev@seagate.com>
Change-Id: I36b471e47e366caae5709f109c28ba57c89f22c7
Reviewed-on: https://review.whamcloud.com/23226
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/functions.sh
lustre/tests/parallel-scale.sh

index 8800650..db134ce 100644 (file)
@@ -1069,3 +1069,70 @@ ior_mdtest_parallel() {
        [[ $rc1 -ne 0 || $rc2 -ne 0 ]] && return 1
        return 0
 }
+
+run_fio() {
+       FIO=${FIO:=$(which fio 2> /dev/null || true)}
+
+       local clients=${CLIENTS:-$(hostname)}
+       local fio_jobNum=${fio_jobNum:-4}
+       local fio_jobFile=${fio_jobFile:-$TMP/fiojobfile.$(date +%s)}
+       local fio_bs=${fio_bs:-1}
+       local testdir=$DIR/d0.fio
+       local file=${testdir}/fio
+       local runtime=60
+       local propagate=false
+
+       [ "$SLOW" = "no" ] || runtime=600
+
+       [ x$FIO = x ] &&
+               { skip_env "FIO not found" && return; }
+
+       mkdir -p $testdir
+
+       # use fio job file if exists,
+       # create a simple one if missing
+       if ! [ -f $fio_jobFile ]; then
+               cat >> $fio_jobFile <<EOF
+[global]
+rw=randwrite
+size=128m
+time_based=1
+runtime=$runtime
+filename=${file}_\$(hostname)
+EOF
+               # bs size increased by $i for each job
+               for ((i=1; i<=fio_jobNum; i++)); do
+                       cat >> $fio_jobFile <<EOF
+
+[job$i]
+bs=$(( fio_bs * i ))m
+EOF
+               done
+               # job file is created, should be propagated to all clients
+               propagate=true
+       fi
+
+
+       # propagate the job file if not all clients have it yet or
+       # if the job file was created during the test run
+       if ! do_nodesv $clients " [ -f $fio_jobFile ] " ||
+          $propagate; then
+               local cfg=$(cat $fio_jobFile)
+               do_nodes $clients "echo \\\"$cfg\\\" > ${fio_jobFile}" ||
+                       error "job file $fio_jobFile is not propagated"
+               do_nodesv $clients "cat ${fio_jobFile}"
+       fi
+
+       cmd="$FIO $fio_jobFile"
+       echo "+ $cmd"
+
+       log "clients: $clients $cmd"
+
+       local rc=0
+       do_nodesv $clients "$cmd "
+       rc=$?
+
+       [ $rc = 0 ] || error "fio failed: $rc"
+       rm -rf $testdir
+}
+
index e87e9a7..ec6d2fc 100644 (file)
@@ -156,6 +156,11 @@ test_fs_test () {
 }
 run_test fs_test "fs_test"
 
+test_fio () {
+       run_fio
+}
+run_test fio "fio"
+
 [ $(facet_fstype $SINGLEMDS) = zfs -o $(facet_fstype "ost1") = zfs ] &&
        SLOW=$ZFSSLOW