test/vhost: remove read tests from vhost initiator

Removing read and randread from test runs as read operations are
performed as part of write with verify enabled tests.

Slight code cleanup included.

Change-Id: Ia3b92ed16cf4c1b873d0f54a0c0677c52f9b726a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383770
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Karol Latecki 2017-10-25 14:23:27 +02:00 committed by Daniel Verkamp
parent b84cf820af
commit 957ebeb506

View File

@ -7,15 +7,21 @@ rootdir=$(readlink -f $testdir/../../..)
plugindir=$rootdir/examples/bdev/fio_plugin plugindir=$rootdir/examples/bdev/fio_plugin
rpc_py="$rootdir/scripts/rpc.py" rpc_py="$rootdir/scripts/rpc.py"
if [ $RUN_NIGHTLY -eq 1 ]; then
fio_rw=("write" "randwrite" "rw" "randrw")
else
fio_rw=("randwrite")
fi
function run_fio() function run_fio() {
{
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=128 --bs=4k --runtime=10 $testdir/bdev.fio "$@" --spdk_mem=1024 LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=128 --bs=4k --runtime=10 $testdir/bdev.fio "$@" --spdk_mem=1024
fio_status=$? fio_status=$?
if [ $fio_status != 0 ]; then if [ $fio_status != 0 ]; then
spdk_vhost_kill spdk_vhost_kill
exit 1 exit 1
fi fi
rm -f *.state
rm -f $testdir/bdev.fio
} }
function prepare_fio_job_for_unmap() { function prepare_fio_job_for_unmap() {
@ -81,27 +87,9 @@ for bdev in $bdevs; do
if [ -d /usr/src/fio ]; then if [ -d /usr/src/fio ]; then
timing_enter fio timing_enter fio
if [ $RUN_NIGHTLY -eq 1 ]; then
fio_rw=("write" "read" "randwrite" "randread" "rw" "randrw")
else
fio_rw=("write" "read")
fi
for rw in "${fio_rw[@]}"; do for rw in "${fio_rw[@]}"; do
timing_enter fio_rw_verify timing_enter fio_rw_verify
cp $testdir/../common/fio_jobs/default_initiator.job $testdir/bdev.fio cp $testdir/../common/fio_jobs/default_initiator.job $testdir/bdev.fio
if [ $rw == "read" ] || [ $rw == "randread" ]; then
echo "size=100m" >> $testdir/bdev.fio
echo "io_size=400m" >> $testdir/bdev.fio
echo "[job_write]" >> $testdir/bdev.fio
echo "stonewall" >> $testdir/bdev.fio
echo "rw=write" >> $testdir/bdev.fio
echo "do_verify=0" >> $testdir/bdev.fio
echo -n "filename=" >> $testdir/bdev.fio
for b in $(echo $bdevs | jq -r '.name'); do
echo -n "$b:" >> $testdir/bdev.fio
done
echo "" >> $testdir/bdev.fio
fi
echo "[job_$rw]" >> $testdir/bdev.fio echo "[job_$rw]" >> $testdir/bdev.fio
echo "stonewall" >> $testdir/bdev.fio echo "stonewall" >> $testdir/bdev.fio
echo "rw=$rw" >> $testdir/bdev.fio echo "rw=$rw" >> $testdir/bdev.fio
@ -112,8 +100,6 @@ for bdev in $bdevs; do
run_fio --spdk_conf=$testdir/bdev.conf run_fio --spdk_conf=$testdir/bdev.conf
rm -f *.state
rm -f $testdir/bdev.fio
timing_exit fio_rw_verify timing_exit fio_rw_verify
done done
@ -121,9 +107,6 @@ for bdev in $bdevs; do
cp $testdir/../common/fio_jobs/default_initiator.job $testdir/bdev.fio cp $testdir/../common/fio_jobs/default_initiator.job $testdir/bdev.fio
prepare_fio_job_for_unmap prepare_fio_job_for_unmap
run_fio --spdk_conf=$testdir/bdev.conf run_fio --spdk_conf=$testdir/bdev.conf
rm -f *.state
rm -f $testdir/bdev.fio
timing_exit fio timing_exit fio
fi fi