test/vhost: small cleanup of spdk_vhost.sh
Fix indentations, rework help message, parametrize VM image. Change-Id: I4a24c840ae2fec1e77c0e53e2ef6dc227272744b Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/387138 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
fbccbb28c7
commit
32408765d5
@ -2,96 +2,115 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ ! -f "/home/sys_sgsw/vhost_vm_image.qcow2" ]; then
|
DEFAULT_VM_IMAGE="/home/sys_sgsw/vhost_vm_image.qcow2"
|
||||||
echo "VM does not exist, exiting vhost tests without running"
|
|
||||||
|
case $1 in
|
||||||
|
-h|--help)
|
||||||
|
echo "usage: $(basename $0) TEST_TYPE"
|
||||||
|
echo "Test type can be:"
|
||||||
|
echo " -i |--integrity for running an integrity test with vhost scsi"
|
||||||
|
echo " -fs|--fs-integrity-scsi for running an integrity test with filesystem"
|
||||||
|
echo " -fb|--fs-integrity-blk for running an integrity test with filesystem"
|
||||||
|
echo " -p |--performance for running a performance test with vhost scsi"
|
||||||
|
echo " -ib|--integrity-blk for running an integrity test with vhost blk"
|
||||||
|
echo " -pb|--performance-blk for running a performance test with vhost blk"
|
||||||
|
echo " -ils|--integrity-lvol-scsi for running an integrity test with vhost scsi and lvol backends"
|
||||||
|
echo " -ilb|--integrity-lvol-blk for running an integrity test with vhost blk and lvol backends"
|
||||||
|
echo " -hp|--hotplug for running hotplug tests"
|
||||||
|
echo " -h |--help prints this message"
|
||||||
|
echo ""
|
||||||
|
echo "Environment:"
|
||||||
|
echo " VM_IMAGE path to QCOW2 VM image used during test (default: $DEFAULT_VM_IMAGE)"
|
||||||
|
echo ""
|
||||||
|
echo "Tests are performed only on Linux machine. For other OS no action is performed."
|
||||||
|
echo ""
|
||||||
|
exit 0;
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "Running SPDK vhost fio autotest..."
|
||||||
|
if [[ $(uname -s) != Linux ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "INFO: Vhost tests are only for Linux machine."
|
||||||
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
: ${VM_IMAGE="$DEFAULT_VM_IMAGE"}
|
||||||
|
|
||||||
|
if [[ ! -r "${VM_IMAGE}" ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "ERROR: VM image '${VM_IMAGE}' does not exist."
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
WORKDIR=$(dirname $0)
|
WORKDIR=$(dirname $0)
|
||||||
cd $WORKDIR
|
cd $WORKDIR
|
||||||
|
|
||||||
param="$1"
|
case $1 in
|
||||||
|
-p|--performance)
|
||||||
if [ $(uname -s) = Linux ]; then
|
echo 'Running performance suite...'
|
||||||
|
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
echo Running SPDK vhost fio autotest...
|
--vm=0,$VM_IMAGE,Nvme0n1p0 \
|
||||||
|
--test-type=spdk_vhost_scsi \
|
||||||
case $param in
|
--fio-jobs=$WORKDIR/common/fio_jobs/default_performance.job \
|
||||||
-p|--performance)
|
--qemu-src=/home/sys_sgsw/vhost/qemu
|
||||||
echo Running performance suite...
|
;;
|
||||||
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
|
||||||
--vm=0,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p0 \
|
|
||||||
--test-type=spdk_vhost_scsi \
|
|
||||||
--fio-jobs=$WORKDIR/common/fio_jobs/default_performance.job \
|
|
||||||
--qemu-src=/home/sys_sgsw/vhost/qemu
|
|
||||||
;;
|
|
||||||
-pb|--performance-blk)
|
-pb|--performance-blk)
|
||||||
echo Running blk performance suite...
|
echo 'Running blk performance suite...'
|
||||||
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
--vm=0,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p0 \
|
--vm=0,$VM_IMAGE,Nvme0n1p0 \
|
||||||
--test-type=spdk_vhost_blk \
|
--test-type=spdk_vhost_blk \
|
||||||
--fio-jobs=$WORKDIR/common/fio_jobs/default_performance.job \
|
--fio-jobs=$WORKDIR/common/fio_jobs/default_performance.job \
|
||||||
--qemu-src=/home/sys_sgsw/vhost/qemu
|
--qemu-src=/home/sys_sgsw/vhost/qemu
|
||||||
;;
|
;;
|
||||||
-i|--integrity)
|
-i|--integrity)
|
||||||
echo Running integrity suite...
|
echo 'Running SCSI integrity suite...'
|
||||||
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
--vm=0,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
||||||
--test-type=spdk_vhost_scsi \
|
--test-type=spdk_vhost_scsi \
|
||||||
--fio-jobs=$WORKDIR/common/fio_jobs/default_integrity.job \
|
--fio-jobs=$WORKDIR/common/fio_jobs/default_integrity.job \
|
||||||
--qemu-src=/home/sys_sgsw/vhost/qemu -x
|
--qemu-src=/home/sys_sgsw/vhost/qemu -x
|
||||||
;;
|
;;
|
||||||
-ib|--integrity-blk)
|
-ib|--integrity-blk)
|
||||||
echo Running blk integrity suite...
|
echo 'Running blk integrity suite...'
|
||||||
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./fiotest/autotest.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
--vm=0,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
||||||
--test-type=spdk_vhost_blk \
|
--test-type=spdk_vhost_blk \
|
||||||
--fio-jobs=$WORKDIR/common/fio_jobs/default_integrity.job \
|
--fio-jobs=$WORKDIR/common/fio_jobs/default_integrity.job \
|
||||||
--qemu-src=/home/sys_sgsw/vhost/qemu -x
|
--qemu-src=/home/sys_sgsw/vhost/qemu -x
|
||||||
;;
|
;;
|
||||||
-fs|--fs-integrity-scsi)
|
-fs|--fs-integrity-scsi)
|
||||||
echo Running filesystem integrity suite...
|
echo 'Running filesystem integrity suite...'
|
||||||
./integrity/integrity_start.sh -i /home/sys_sgsw/vhost_vm_image.qcow2 -m scsi -f ntfs
|
./integrity/integrity_start.sh -i $VM_IMAGE -m scsi -f ntfs
|
||||||
;;
|
;;
|
||||||
-fb|--fs-integrity-blk)
|
-fb|--fs-integrity-blk)
|
||||||
echo Running filesystem integrity suite...
|
echo 'Running filesystem integrity suite...'
|
||||||
./integrity/integrity_start.sh -i /home/sys_sgsw/vhost_vm_image.qcow2 -m blk -f ntfs
|
./integrity/integrity_start.sh -i $VM_IMAGE -m blk -f ntfs
|
||||||
;;
|
;;
|
||||||
-ils|--integrity-lvol-scsi)
|
-ils|--integrity-lvol-scsi)
|
||||||
echo Running lvol integrity suite...
|
echo 'Running lvol integrity suite...'
|
||||||
./lvol/lvol_test.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./lvol/lvol_test.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
--ctrl-type=vhost_scsi
|
--ctrl-type=vhost_scsi
|
||||||
;;
|
;;
|
||||||
-ilb|--integrity-lvol-blk)
|
-ilb|--integrity-lvol-blk)
|
||||||
echo Running lvol integrity suite...
|
echo 'Running lvol integrity suite...'
|
||||||
./lvol/lvol_test.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./lvol/lvol_test.sh --fio-bin=/home/sys_sgsw/fio_ubuntu -ctrl-type=vhost_blk
|
||||||
--ctrl-type=vhost_blk
|
;;
|
||||||
;;
|
|
||||||
-hp|--hotplug)
|
-hp|--hotplug)
|
||||||
echo Running hotplug tests suite...
|
echo 'Running hotplug tests suite...'
|
||||||
./hotplug/scsi_hotplug.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
./hotplug/scsi_hotplug.sh --fio-bin=/home/sys_sgsw/fio_ubuntu \
|
||||||
--vm=0,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p0:Nvme0n1p1 \
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1 \
|
||||||
--vm=1,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p2:Nvme0n1p3 \
|
--vm=1,$VM_IMAGE,Nvme0n1p2:Nvme0n1p3 \
|
||||||
--vm=2,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p4:Nvme0n1p5 \
|
--vm=2,$VM_IMAGE,Nvme0n1p4:Nvme0n1p5 \
|
||||||
--vm=3,/home/sys_sgsw/vhost_vm_image.qcow2,Nvme0n1p6:Nvme0n1p7 \
|
--vm=3,$VM_IMAGE,Nvme0n1p6:Nvme0n1p7 \
|
||||||
--test-type=spdk_vhost_scsi \
|
--test-type=spdk_vhost_scsi \
|
||||||
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job -x
|
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job -x
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
*)
|
||||||
echo "-i |--integrity for running an integrity test with vhost scsi"
|
echo "unknown test type: $1"
|
||||||
echo "-fs|--fs-integrity-scsi for running an integrity test with filesystem"
|
exit 1
|
||||||
echo "-fb|--fs-integrity-blk for running an integrity test with filesystem"
|
;;
|
||||||
echo "-p |--performance for running a performance test with vhost scsi"
|
|
||||||
echo "-ib|--integrity-blk for running an integrity test with vhost blk"
|
|
||||||
echo "-pb|--performance-blk for running a performance test with vhost blk"
|
|
||||||
echo "-ils|--integrity-lvol-scsi for running an integrity test with vhost scsi and lvol backends"
|
|
||||||
echo "-ilb|--integrity-lvol-blk for running an integrity test with vhost blk and lvol backends"
|
|
||||||
echo "-hp|--hotplug for running hotplug tests"
|
|
||||||
echo "-h |--help prints this message"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unknown test type"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user