vhost: Shift some test code from spdk_vhost.sh to vhost.sh

Beginning to shift the test script model to match the other
tests in SPDK.

Change-Id: Ica146fd7d66de904ad7a9b774eca13bf0510c297
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452264
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Ben Walker 2019-04-24 16:14:21 -07:00 committed by Darek Stojaczyk
parent 2061874474
commit 31783d98e6
2 changed files with 97 additions and 118 deletions

View File

@ -13,21 +13,11 @@ 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 " -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 " -shr|--scsi-hot-remove for running scsi hot remove tests"
echo " -bhr|--blk-hot-remove for running blk hot remove tests"
echo " -ro|--readonly for running readonly test for vhost blk"
echo " -b|--boot for booting vm from vhost controller"
echo " -h |--help prints this message"
echo ""
echo "Environment:"
@ -62,11 +52,6 @@ DISKS_NUMBER=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$
WORKDIR=$(readlink -f $(dirname $0))
case $1 in
-n|--negative)
echo 'Negative tests suite...'
run_test case $WORKDIR/other/negative.sh
report_test_completion "vhost_negative"
;;
-p|--performance)
echo 'Running performance suite...'
run_test case $WORKDIR/fiotest/autotest.sh --fio-bin=$FIO_BIN \
@ -83,87 +68,6 @@ case $1 in
--fio-job=$WORKDIR/common/fio_jobs/default_performance.job
report_test_completion "vhost_perf_blk"
;;
-m|--migration)
echo 'Running migration suite...'
run_test case $WORKDIR/migration/migration.sh -x \
--fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1,2
;;
-i|--integrity)
echo 'Running SCSI integrity suite...'
run_test case $WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
--vm=0,$VM_IMAGE,Nvme0n1p0:RaidBdev0:RaidBdev1:RaidBdev2 \
--test-type=spdk_vhost_scsi \
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
report_test_completion "nightly_vhost_integrity"
;;
-ib|--integrity-blk)
echo 'Running blk integrity suite...'
run_test case $WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
--vm=0,$VM_IMAGE,Nvme0n1p0:RaidBdev0:RaidBdev1:RaidBdev2 \
--test-type=spdk_vhost_blk \
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
report_test_completion "nightly_vhost_integrity_blk"
;;
-fs|--fs-integrity-scsi)
echo 'Running filesystem integrity suite with SCSI...'
run_test case $WORKDIR/integrity/integrity_start.sh --ctrl-type=spdk_vhost_scsi --fs="xfs ntfs btrfs ext4"
report_test_completion "vhost_fs_integrity_scsi"
;;
-fb|--fs-integrity-blk)
echo 'Running filesystem integrity suite with BLK...'
run_test case $WORKDIR/integrity/integrity_start.sh --ctrl-type=spdk_vhost_blk --fs="xfs ntfs btrfs ext4"
report_test_completion "vhost_fs_integrity_blk"
;;
-ils|--integrity-lvol-scsi)
echo 'Running lvol integrity suite...'
run_test case $WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_scsi --thin-provisioning
report_test_completion "vhost_integrity_lvol_scsi"
;;
-ilb|--integrity-lvol-blk)
echo 'Running lvol integrity suite...'
run_test case $WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk
report_test_completion "vhost_integrity_lvol_blk"
;;
-ilsn|--integrity-lvol-scsi-nightly)
if [[ $DISKS_NUMBER -ge 2 ]]; then
echo 'Running lvol integrity nightly suite with two cores and two controllers'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--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'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_scsi --max-disks=2 --vm-count=2
fi
if [[ -e $CENTOS_VM_IMAGE ]]; then
echo 'Running lvol integrity nightly suite with different os types'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
--ctrl-type=spdk_vhost_scsi --vm-count=2 --multi-os
fi
echo 'Running lvol integrity nightly suite with one core and one controller'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--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'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--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'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk --max-disks=2 --vm-count=2
fi
if [[ -e $CENTOS_VM_IMAGE ]]; then
echo 'Running lvol integrity nightly suite with different os types'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
--ctrl-type=spdk_vhost_blk --vm-count=2 --multi-os
fi
echo 'Running lvol integrity nightly suite with one core and one controller'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk --max-disks=1
;;
-hp|--hotplug)
echo 'Running hotplug tests suite...'
run_test case $WORKDIR/hotplug/scsi_hotplug.sh --fio-bin=$FIO_BIN \
@ -193,16 +97,6 @@ case $1 in
--blk-hotremove-test \
--fio-jobs=$WORKDIR/hotplug/fio_jobs/default_integrity.job
;;
-ro|--readonly)
echo 'Running readonly tests suite...'
run_test case $WORKDIR/readonly/readonly.sh --vm_image=$VM_IMAGE --disk=Nvme0n1 -x
report_test_completion "vhost_readonly"
;;
-b|--boot)
echo 'Running os boot from vhost controller...'
$WORKDIR/vhost_boot/vhost_boot.sh --vm_image=$VM_IMAGE
report_test_completion "vhost_boot"
;;
*)
echo "unknown test type: $1"
exit 1

View File

@ -3,57 +3,142 @@ testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
echo "Running SPDK vhost fio autotest..."
if [[ $(uname -s) != Linux ]]; then
echo ""
echo "INFO: Vhost tests are only for Linux machine."
echo ""
exit 0
fi
DEFAULT_VM_IMAGE="/home/sys_sgsw/vhost_vm_image.qcow2"
CENTOS_VM_IMAGE="/home/sys_sgsw/spdk_vhost_CentOS_vm_image.qcow2"
DEFAULT_FIO_BIN="/home/sys_sgsw/fio_ubuntu"
CENTOS_FIO_BIN="/home/sys_sgsw/fio_ubuntu_bak"
: ${VM_IMAGE="$DEFAULT_VM_IMAGE"}
: ${FIO_BIN="$DEFAULT_FIO_BIN"}
if [[ ! -r "${VM_IMAGE}" ]]; then
echo ""
echo "ERROR: VM image '${VM_IMAGE}' does not exist."
echo ""
exit 1
fi
DISKS_NUMBER=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l`
WORKDIR=$(readlink -f $(dirname $0))
timing_enter vhost
timing_enter negative
run_test suite ./test/vhost/spdk_vhost.sh --negative
run_test case $WORKDIR/other/negative.sh
report_test_completion "vhost_negative"
timing_exit negative
timing_enter vhost_boot
run_test suite ./test/vhost/spdk_vhost.sh --boot
run_test suite $WORKDIR/vhost_boot/vhost_boot.sh --vm_image=$VM_IMAGE
report_test_completion "vhost_boot"
timing_exit vhost_boot
if [ $RUN_NIGHTLY -eq 1 ]; then
timing_enter integrity_blk
run_test suite ./test/vhost/spdk_vhost.sh --integrity-blk
echo 'Running blk integrity suite...'
run_test case $WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
--vm=0,$VM_IMAGE,Nvme0n1p0:RaidBdev0:RaidBdev1:RaidBdev2 \
--test-type=spdk_vhost_blk \
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
report_test_completion "nightly_vhost_integrity_blk"
timing_exit integrity_blk
timing_enter integrity
run_test suite ./test/vhost/spdk_vhost.sh --integrity
echo 'Running SCSI integrity suite...'
run_test case $WORKDIR/fiotest/autotest.sh -x --fio-bin=$FIO_BIN \
--vm=0,$VM_IMAGE,Nvme0n1p0:RaidBdev0:RaidBdev1:RaidBdev2 \
--test-type=spdk_vhost_scsi \
--fio-job=$WORKDIR/common/fio_jobs/default_integrity.job
report_test_completion "nightly_vhost_integrity"
timing_exit integrity
timing_enter fs_integrity_scsi
run_test suite ./test/vhost/spdk_vhost.sh --fs-integrity-scsi
echo 'Running filesystem integrity suite with SCSI...'
run_test case $WORKDIR/integrity/integrity_start.sh --ctrl-type=spdk_vhost_scsi --fs="xfs ntfs btrfs ext4"
report_test_completion "vhost_fs_integrity_scsi"
timing_exit fs_integrity_scsi
timing_enter fs_integrity_blk
run_test suite ./test/vhost/spdk_vhost.sh --fs-integrity-blk
echo 'Running filesystem integrity suite with BLK...'
run_test case $WORKDIR/integrity/integrity_start.sh --ctrl-type=spdk_vhost_blk --fs="xfs ntfs btrfs ext4"
report_test_completion "vhost_fs_integrity_blk"
timing_exit fs_integrity_blk
timing_enter integrity_lvol_scsi_nightly
run_test suite ./test/vhost/spdk_vhost.sh --integrity-lvol-scsi-nightly
if [[ $DISKS_NUMBER -ge 2 ]]; then
echo 'Running lvol integrity nightly suite with two cores and two controllers'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--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'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_scsi --max-disks=2 --vm-count=2
fi
if [[ -e $CENTOS_VM_IMAGE ]]; then
echo 'Running lvol integrity nightly suite with different os types'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
--ctrl-type=spdk_vhost_scsi --vm-count=2 --multi-os
fi
echo 'Running lvol integrity nightly suite with one core and one controller'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_scsi --max-disks=1
timing_exit integrity_lvol_scsi_nightly
timing_enter integrity_lvol_blk_nightly
run_test suite ./test/vhost/spdk_vhost.sh --integrity-lvol-blk-nightly
if [[ $DISKS_NUMBER -ge 2 ]]; then
echo 'Running lvol integrity nightly suite with two cores and two controllers'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--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'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk --max-disks=2 --vm-count=2
fi
if [[ -e $CENTOS_VM_IMAGE ]]; then
echo 'Running lvol integrity nightly suite with different os types'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$CENTOS_FIO_BIN \
--ctrl-type=spdk_vhost_blk --vm-count=2 --multi-os
fi
echo 'Running lvol integrity nightly suite with one core and one controller'
run_test case $WORKDIR/lvol/lvol_test.sh --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk --max-disks=1
timing_exit integrity_lvol_blk_nightly
fi
if [ $RUN_NIGHTLY_FAILING -eq 1 ]; then
timing_enter vhost_migration
run_test suite ./test/vhost/spdk_vhost.sh --migration
echo 'Running migration suite...'
run_test case $WORKDIR/migration/migration.sh -x \
--fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1,2
timing_exit vhost_migration
timing_enter readonly
run_test suite ./test/vhost/spdk_vhost.sh --readonly
echo 'Running readonly tests suite...'
run_test case $WORKDIR/readonly/readonly.sh --vm_image=$VM_IMAGE --disk=Nvme0n1 -x
report_test_completion "vhost_readonly"
timing_exit readonly
fi
timing_enter integrity_lvol_scsi
run_test suite ./test/vhost/spdk_vhost.sh --integrity-lvol-scsi
echo 'Running lvol integrity suite...'
run_test case $WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_scsi --thin-provisioning
report_test_completion "vhost_integrity_lvol_scsi"
timing_exit integrity_lvol_scsi
timing_enter integrity_lvol_blk
run_test suite ./test/vhost/spdk_vhost.sh --integrity-lvol-blk
echo 'Running lvol integrity suite...'
run_test case $WORKDIR/lvol/lvol_test.sh -x --fio-bin=$FIO_BIN \
--ctrl-type=spdk_vhost_blk
report_test_completion "vhost_integrity_lvol_blk"
timing_exit integrity_lvol_blk
timing_enter spdk_cli