2017-03-02 14:12:20 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-06-10 07:16:46 +00:00
|
|
|
|
2019-05-10 17:54:24 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/vhost/common.sh
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
case $1 in
|
2020-05-07 11:27:06 +00:00
|
|
|
-h | --help)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo "usage: $(basename $0) TEST_TYPE"
|
|
|
|
echo "Test type can be:"
|
2017-11-27 16:47:15 +00:00
|
|
|
echo " -p |--performance for running a performance test with vhost scsi"
|
|
|
|
echo " -pb|--performance-blk for running a performance test with vhost blk"
|
|
|
|
echo " -hp|--hotplug for running hotplug tests"
|
2017-12-18 15:02:24 +00:00
|
|
|
echo " -shr|--scsi-hot-remove for running scsi hot remove tests"
|
2017-12-20 13:26:59 +00:00
|
|
|
echo " -bhr|--blk-hot-remove for running blk hot remove tests"
|
2017-11-27 16:47:15 +00:00
|
|
|
echo " -h |--help prints this message"
|
2017-11-14 14:52:20 +00:00
|
|
|
echo ""
|
|
|
|
echo "Environment:"
|
2021-03-18 14:13:10 +00:00
|
|
|
echo " VM_IMAGE path to QCOW2 VM image used during test (default: $DEPENDENCY_DIR/spdk_test_image.qcow2)"
|
2017-11-14 14:52:20 +00:00
|
|
|
echo ""
|
|
|
|
echo "Tests are performed only on Linux machine. For other OS no action is performed."
|
|
|
|
echo ""
|
2020-05-07 11:27:06 +00:00
|
|
|
exit 0
|
2017-11-14 14:52:20 +00:00
|
|
|
;;
|
|
|
|
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
|
|
|
|
|
2021-02-10 10:58:10 +00:00
|
|
|
vhosttestinit
|
2017-03-02 14:12:20 +00:00
|
|
|
|
2017-11-14 14:52:20 +00:00
|
|
|
case $1 in
|
2020-05-07 11:27:06 +00:00
|
|
|
-hp | --hotplug)
|
2017-11-14 14:52:20 +00:00
|
|
|
echo 'Running hotplug tests suite...'
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vhost_hotplug" $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
|
|
|
;;
|
2020-05-07 11:27:06 +00:00
|
|
|
-shr | --scsi-hot-remove)
|
2017-12-18 15:02:24 +00:00
|
|
|
echo 'Running scsi hotremove tests suite...'
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vhost_scsi_hot_remove" $WORKDIR/hotplug/scsi_hotplug.sh --fio-bin=$FIO_BIN \
|
2017-12-18 15:02:24 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1 \
|
|
|
|
--vm=1,$VM_IMAGE,Nvme0n1p2:Nvme0n1p3 \
|
|
|
|
--test-type=spdk_vhost_scsi \
|
|
|
|
--scsi-hotremove-test \
|
2020-02-27 16:58:44 +00:00
|
|
|
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job
|
2017-12-18 15:02:24 +00:00
|
|
|
;;
|
2020-05-07 11:27:06 +00:00
|
|
|
-bhr | --blk-hot-remove)
|
2017-12-20 13:26:59 +00:00
|
|
|
echo 'Running blk hotremove tests suite...'
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "vhost_blk_hot_remove" $WORKDIR/hotplug/scsi_hotplug.sh --fio-bin=$FIO_BIN \
|
2017-12-20 13:26:59 +00:00
|
|
|
--vm=0,$VM_IMAGE,Nvme0n1p0:Nvme0n1p1 \
|
|
|
|
--vm=1,$VM_IMAGE,Nvme0n1p2:Nvme0n1p3 \
|
|
|
|
--test-type=spdk_vhost_blk \
|
|
|
|
--blk-hotremove-test \
|
2020-02-27 16:58:44 +00:00
|
|
|
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job
|
|
|
|
;;
|
2017-11-14 14:52:20 +00:00
|
|
|
*)
|
|
|
|
echo "unknown test type: $1"
|
|
|
|
exit 1
|
2020-05-07 11:27:06 +00:00
|
|
|
;;
|
2017-03-02 14:12:20 +00:00
|
|
|
esac
|