2017-03-02 14:12:20 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-03-07 00:45:49 +00:00
|
|
|
set -e
|
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
DEFAULT_VM_IMAGE="/home/sys_sgsw/vhost_vm_image.qcow2"
|
2018-01-04 08:39:01 +00:00
|
|
|
CENTOS_VM_IMAGE="/home/sys_sgsw/spdk_vhost_CentOS_vm_image.qcow2"
|
2017-12-27 15:29:03 +00:00
|
|
|
DEFAULT_FIO_BIN="/home/sys_sgsw/fio_ubuntu"
|
2018-01-04 08:39:01 +00:00
|
|
|
CENTOS_FIO_BIN="/home/sys_sgsw/fio_ubuntu_bak"
|
2017-11-14 14:52:20 +00:00
|
|
|
|
|
|
|
case $1 in
|
|
|
|
-h|--help)
|
|
|
|
echo "usage: $(basename $0) TEST_TYPE"
|
|
|
|
echo "Test type can be:"
|
2017-11-27 16:47:15 +00:00
|
|
|
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 " -ilsn|--integrity-lvol-scsi-nightly for running an nightly integrity test with vhost scsi and lvol backends"
|
|
|
|
echo " -ilbn|--integrity-lvol-blk-nightly for running an nightly integrity test with vhost blk and lvol backends"
|
|
|
|
echo " -hp|--hotplug for running hotplug tests"
|
|
|
|
echo " -ro|--readonly for running readonly test for vhost blk"
|
|
|
|
echo " -h |--help prints this message"
|
2017-11-14 14:52:20 +00:00
|
|
|
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 ""
|
2017-03-07 23:11:58 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
: ${VM_IMAGE="$DEFAULT_VM_IMAGE"}
|
2017-12-27 15:29:03 +00:00
|
|
|
: ${FIO_BIN="$DEFAULT_FIO_BIN"}
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
if [[ ! -r "${VM_IMAGE}" ]]; then
|
|
|
|
echo ""
|
|
|
|
echo "ERROR: VM image '${VM_IMAGE}' does not exist."
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2017-11-27 16:47:15 +00:00
|
|
|
DISKS_NUMBER=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l`
|
|
|
|
|
2017-12-22 08:30:14 +00:00
|
|
|
WORKDIR=$(readlink -f $(dirname $0))
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
case $1 in
|
2017-11-15 13:56:07 +00:00
|
|
|
-n|--negative)
|
|
|
|
echo 'Negative tests suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/other/negative.sh
|
2017-12-27 15:29:03 +00:00
|
|
|
;;
|
2017-11-14 14:52:20 +00:00
|
|
|
-p|--performance)
|
|
|
|
echo 'Running performance suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/fiotest/autotest.sh --fio-bin=$FIO_BIN \
|
2017-11-14 14:52:20 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0 \
|
|
|
|
--test-type=spdk_vhost_scsi \
|
2017-12-15 17:29:26 +00:00
|
|
|
--fio-job=$WORKDIR/common/fio_jobs/default_performance.job
|
2017-12-27 15:29:03 +00:00
|
|
|
;;
|
2017-06-16 10:03:46 +00:00
|
|
|
-pb|--performance-blk)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running blk performance suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/fiotest/autotest.sh --fio-bin=$FIO_BIN \
|
2017-11-14 14:52:20 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0 \
|
|
|
|
--test-type=spdk_vhost_blk \
|
2017-12-15 17:29:26 +00:00
|
|
|
--fio-job=$WORKDIR/common/fio_jobs/default_performance.job
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2018-01-03 13:24:38 +00:00
|
|
|
-m|--migration)
|
|
|
|
echo 'Running migration suite...'
|
2018-01-31 14:50:16 +00:00
|
|
|
$WORKDIR/migration/migration.sh -x \
|
2018-01-31 15:10:26 +00:00
|
|
|
--fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1
|
2018-01-03 13:24:38 +00:00
|
|
|
;;
|
2017-11-14 14:52:20 +00:00
|
|
|
-i|--integrity)
|
|
|
|
echo 'Running SCSI integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
|
2017-11-14 14:52:20 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
|
|
|
--test-type=spdk_vhost_scsi \
|
2017-12-27 15:29:03 +00:00
|
|
|
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
|
|
|
-ib|--integrity-blk)
|
|
|
|
echo 'Running blk integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
|
2017-11-14 14:52:20 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1:Nvme0n1p2:Nvme0n1p3 \
|
|
|
|
--test-type=spdk_vhost_blk \
|
2017-12-27 15:29:03 +00:00
|
|
|
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-08-09 10:38:11 +00:00
|
|
|
-fs|--fs-integrity-scsi)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running filesystem integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/integrity/integrity_start.sh -i $VM_IMAGE -m scsi -f "xfs ntfs btrfs ext4"
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-08-09 10:38:11 +00:00
|
|
|
-fb|--fs-integrity-blk)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running filesystem integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/integrity/integrity_start.sh -i $VM_IMAGE -m blk -f "xfs ntfs btrfs ext4"
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-07-25 10:27:43 +00:00
|
|
|
-ils|--integrity-lvol-scsi)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running lvol integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
|
2018-01-05 12:21:48 +00:00
|
|
|
--ctrl-type=spdk_vhost_scsi --thin-provisioning
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-07-25 10:27:43 +00:00
|
|
|
-ilb|--integrity-lvol-blk)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running lvol integrity suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
|
2018-02-14 23:02:16 +00:00
|
|
|
--ctrl-type=spdk_vhost_blk
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-11-27 16:47:15 +00:00
|
|
|
-ilsn|--integrity-lvol-scsi-nightly)
|
|
|
|
if [[ $DISKS_NUMBER -ge 2 ]]; then
|
|
|
|
echo 'Running lvol integrity nightly suite with two cores and two controllers'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_scsi --max-disks=2 --distribute-cores --vm-count=2
|
|
|
|
|
|
|
|
echo 'Running lvol integrity nightly suite with one core and two controllers'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_scsi --max-disks=2 --vm-count=2
|
|
|
|
fi
|
2018-01-04 08:39:01 +00:00
|
|
|
if [[ -e $CENTOS_VM_IMAGE ]]; then
|
|
|
|
echo 'Running lvol integrity nightly suite with different os types'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
|
2018-01-04 08:39:01 +00:00
|
|
|
--ctrl-type=spdk_vhost_scsi --vm-count=2 --multi-os
|
|
|
|
fi
|
2017-11-27 16:47:15 +00:00
|
|
|
echo 'Running lvol integrity nightly suite with one core and one controller'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_scsi --max-disks=1
|
|
|
|
;;
|
|
|
|
-ilbn|--integrity-lvol-blk-nightly)
|
|
|
|
if [[ $DISKS_NUMBER -ge 2 ]]; then
|
|
|
|
echo 'Running lvol integrity nightly suite with two cores and two controllers'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_blk --max-disks=2 --distribute-cores --vm-count=2
|
|
|
|
|
|
|
|
echo 'Running lvol integrity nightly suite with one core and two controllers'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_blk --max-disks=2 --vm-count=2
|
|
|
|
fi
|
2018-01-04 08:39:01 +00:00
|
|
|
if [[ -e $CENTOS_VM_IMAGE ]]; then
|
|
|
|
echo 'Running lvol integrity nightly suite with different os types'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
|
2018-01-04 08:39:01 +00:00
|
|
|
--ctrl-type=spdk_vhost_blk --vm-count=2 --multi-os
|
|
|
|
fi
|
2017-11-27 16:47:15 +00:00
|
|
|
echo 'Running lvol integrity nightly suite with one core and one controller'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
|
2017-11-27 16:47:15 +00:00
|
|
|
--ctrl-type=spdk_vhost_blk --max-disks=1
|
|
|
|
;;
|
2017-08-02 17:13:48 +00:00
|
|
|
-hp|--hotplug)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running hotplug tests suite...'
|
2018-02-08 18:15:33 +00:00
|
|
|
$WORKDIR/hotplug/scsi_hotplug.sh --fio-bin=$FIO_BIN \
|
2017-11-14 14:52:20 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1 \
|
|
|
|
--vm=1,$VM_IMAGE,Nvme0n1p2:Nvme0n1p3 \
|
|
|
|
--vm=2,$VM_IMAGE,Nvme0n1p4:Nvme0n1p5 \
|
|
|
|
--vm=3,$VM_IMAGE,Nvme0n1p6:Nvme0n1p7 \
|
|
|
|
--test-type=spdk_vhost_scsi \
|
2017-12-15 20:26:43 +00:00
|
|
|
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job -x
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
2017-10-17 18:59:36 +00:00
|
|
|
-ro|--readonly)
|
|
|
|
echo 'Running readonly tests suite...'
|
2018-02-13 18:49:46 +00:00
|
|
|
$WORKDIR/readonly/readonly.sh --vm_image=$VM_IMAGE --disk=Nvme0n1
|
2017-10-17 18:59:36 +00:00
|
|
|
;;
|
2017-11-14 14:52:20 +00:00
|
|
|
*)
|
|
|
|
echo "unknown test type: $1"
|
|
|
|
exit 1
|
|
|
|
;;
|
2017-03-02 14:12:20 +00:00
|
|
|
esac
|