From e8650a81eefb8ab56de9eb01a8ad7eb83d763d99 Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Thu, 4 Jan 2018 16:39:01 +0800 Subject: [PATCH] autotest: vhost_multi_os_test (porting from nightly to autotest) Add vhost-scsi and vhost-blk multi-os test case which used Ubuntu and Centos VM in nightly Fix vhost nightly readonly case for vm shutdown timeout The 10s isn't long enough for the VM to shutdown so the script trap error in line "((timeo-=1))" in common.sh script and exit Change-Id: I5a44a2b1bf6b3247383603d5896b8bdde16a9a45 Signed-off-by: Chen Wang Reviewed-on: https://review.gerrithub.io/393602 Tested-by: SPDK Automated Test System Reviewed-by: qun wan Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- test/vhost/common/common.sh | 2 +- test/vhost/lvol/lvol_test.sh | 9 ++++++++- test/vhost/spdk_vhost.sh | 12 ++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/test/vhost/common/common.sh b/test/vhost/common/common.sh index b310e76b0..6a10b18c6 100644 --- a/test/vhost/common/common.sh +++ b/test/vhost/common/common.sh @@ -387,7 +387,7 @@ function vm_shutdown_all() done notice "Waiting for VMs to shutdown..." - timeo=10 + timeo=15 while [[ $timeo -gt 0 ]]; do all_vms_down=1 for vm in $VM_BASE_DIR/[0-9]*; do diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index 3c160c434..8dc4367c0 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -45,6 +45,8 @@ function usage() echo " on different CPU cores instead of single core." echo " Default: False" echo "-x set -x for script debug" + echo " --multi-os Run tests on different os types in VMs" + echo " Default: False" exit 0 } @@ -87,6 +89,7 @@ while getopts 'xh-:' optchar; do nested-lvol) nested_lvol=true ;; distribute-cores) distribute_cores=true ;; thin-provisioning) thin=" -t " ;; + multi-os) multi_os=true ;; *) usage $0 "Invalid argument '$OPTARG'" ;; esac ;; @@ -182,7 +185,11 @@ for (( i=0; i<$vm_count; i++)); do bdevs=($bdevs) setup_cmd="vm_setup --disk-type=$ctrl_type --force=$i" - setup_cmd+=" --os=/home/sys_sgsw/vhost_vm_image.qcow2" + if [[ $i%2 -ne 0 ]] && [[ $multi_os ]]; then + setup_cmd+=" --os=/home/sys_sgsw/spdk_vhost_CentOS_vm_image.qcow2" + else + setup_cmd+=" --os=/home/sys_sgsw/vhost_vm_image.qcow2" + fi # Create single SCSI controller or multiple BLK controllers for this VM if $distribute_cores; then diff --git a/test/vhost/spdk_vhost.sh b/test/vhost/spdk_vhost.sh index 248e325c1..7e90e8eaa 100755 --- a/test/vhost/spdk_vhost.sh +++ b/test/vhost/spdk_vhost.sh @@ -3,7 +3,9 @@ set -e 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" case $1 in -h|--help) @@ -121,6 +123,11 @@ case $1 in ./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' + ./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' ./lvol/lvol_test.sh --fio-bin=$FIO_BIN \ --ctrl-type=spdk_vhost_scsi --max-disks=1 @@ -135,6 +142,11 @@ case $1 in ./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' + ./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' ./lvol/lvol_test.sh --fio-bin=$FIO_BIN \ --ctrl-type=spdk_vhost_blk --max-disks=1