From 10a0f053c98f9d727ed17b791dba2c16a32268d4 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Wed, 5 Jun 2019 12:47:53 -0700 Subject: [PATCH] test/vhost: Require vhost num as first arg to vhost_run Making this explicit makes the tests clearer Change-Id: I6c37f873683b38b644bebc42532694d45a181d04 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461387 Tested-by: SPDK CI Jenkins Reviewed-by: Maciej Szwed Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- test/vhost/common.sh | 9 ++++----- test/vhost/fiotest/fio.sh | 2 +- test/vhost/hotplug/scsi_hotplug.sh | 2 +- test/vhost/initiator/blockdev.sh | 2 +- test/vhost/integrity/integrity_start.sh | 2 +- test/vhost/lvol/lvol_test.sh | 2 +- test/vhost/migration/migration-tc1.sh | 2 +- test/vhost/migration/migration-tc2.sh | 4 ++-- test/vhost/migration/migration-tc3a.sh | 2 +- test/vhost/other/negative.sh | 2 +- test/vhost/perf_bench/vhost_perf.sh | 2 +- test/vhost/readonly/readonly.sh | 2 +- test/vhost/shared/shared.sh | 2 +- test/vhost/vhost_boot/vhost_boot.sh | 2 +- test/vhost/windows/windows.sh | 2 +- test/vhost/windows/windows_scsi_compliance.sh | 2 +- 16 files changed, 20 insertions(+), 21 deletions(-) diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 0fae2d624..5e4e9335c 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -121,15 +121,14 @@ function vhost_list_all() function vhost_run() { local param - local vhost_num=0 + local vhost_num="$1" local memory=1024 + assert_number "$vhost_num" + shift + for param in "$@"; do case $param in - --vhost-num=*) - vhost_num="${param#*=}" - assert_number "$vhost_num" - ;; --memory=*) local memory=${param#*=} ;; --no-pci*) local no_pci="-u" ;; *) diff --git a/test/vhost/fiotest/fio.sh b/test/vhost/fiotest/fio.sh index fc21fdb8d..908a35968 100755 --- a/test/vhost/fiotest/fio.sh +++ b/test/vhost/fiotest/fio.sh @@ -81,7 +81,7 @@ if [[ $test_type =~ "spdk_vhost" ]]; then notice "" notice "running SPDK" notice "" - vhost_run + vhost_run 0 vhost_json_config 0 $testdir/conf.json notice "" fi diff --git a/test/vhost/hotplug/scsi_hotplug.sh b/test/vhost/hotplug/scsi_hotplug.sh index 53e3c1973..8320821c2 100755 --- a/test/vhost/hotplug/scsi_hotplug.sh +++ b/test/vhost/hotplug/scsi_hotplug.sh @@ -61,7 +61,7 @@ notice "===============" notice "" notice "running SPDK" notice "" -vhost_run +vhost_run 0 $rpc_py set_bdev_nvme_hotplug -e $rpc_py construct_split_vbdev Nvme0n1 16 $rpc_py construct_malloc_bdev 128 512 -b Malloc diff --git a/test/vhost/initiator/blockdev.sh b/test/vhost/initiator/blockdev.sh index 5cd6b6669..c49d5a243 100755 --- a/test/vhost/initiator/blockdev.sh +++ b/test/vhost/initiator/blockdev.sh @@ -88,7 +88,7 @@ function create_bdev_config() } timing_enter vhost_run -vhost_run +vhost_run 0 timing_exit vhost_run timing_enter create_bdev_config diff --git a/test/vhost/integrity/integrity_start.sh b/test/vhost/integrity/integrity_start.sh index 0d6e30f61..103f21e66 100755 --- a/test/vhost/integrity/integrity_start.sh +++ b/test/vhost/integrity/integrity_start.sh @@ -60,7 +60,7 @@ trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR vm_kill_all notice "Starting SPDK vhost" -vhost_run +vhost_run 0 notice "..." # Set up lvols and vhost controllers diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index bd8a4c747..4e5116387 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -120,7 +120,7 @@ trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR vm_kill_all notice "running SPDK vhost" -vhost_run +vhost_run 0 notice "..." trap 'clean_lvol_cfg; error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR diff --git a/test/vhost/migration/migration-tc1.sh b/test/vhost/migration/migration-tc1.sh index 685c19cd1..7a5ddc288 100644 --- a/test/vhost/migration/migration-tc1.sh +++ b/test/vhost/migration/migration-tc1.sh @@ -57,7 +57,7 @@ function migration_tc1() local job_file="$testdir/migration-tc1.job" # Run vhost - vhost_run + vhost_run 0 migration_tc1_configure_vhost notice "Setting up VMs" diff --git a/test/vhost/migration/migration-tc2.sh b/test/vhost/migration/migration-tc2.sh index dc6f56952..cec1d9871 100644 --- a/test/vhost/migration/migration-tc2.sh +++ b/test/vhost/migration/migration-tc2.sh @@ -102,11 +102,11 @@ function migration_tc2_configure_vhost() $rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config timing_exit start_nvmf_tgt - vhost_run --memory=512 --vhost-num=0 --no-pci + vhost_run 0 --memory=512 --no-pci # Those are global intentionally vhost_1_reactor_mask=0x2 vhost_1_master_core=1 - vhost_run --memory=512 --vhost-num=1 --no-pci + vhost_run 1 --memory=512 --no-pci local rdma_ip_list=$(get_available_rdma_ips) local nvmf_target_ip=$(echo "$rdma_ip_list" | head -n 1) diff --git a/test/vhost/migration/migration-tc3a.sh b/test/vhost/migration/migration-tc3a.sh index d53d02351..fcc1d4441 100644 --- a/test/vhost/migration/migration-tc3a.sh +++ b/test/vhost/migration/migration-tc3a.sh @@ -122,7 +122,7 @@ function host1_start_vhost() notice "Starting vhost0 instance on local server" trap 'host1_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT - vhost_run --vhost-num=0 --no-pci + vhost_run 0 --no-pci $rpc_0 construct_nvme_bdev -b Nvme0 -t rdma -f ipv4 -a $RDMA_TARGET_IP -s 4420 -n "nqn.2018-02.io.spdk:cnode1" $rpc_0 construct_vhost_scsi_controller $incoming_vm_ctrlr $rpc_0 add_vhost_scsi_lun $incoming_vm_ctrlr 0 Nvme0n1 diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index fc2bed8ab..b2e0d2dde 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -69,7 +69,7 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then notice "" notice "running SPDK" notice "" - vhost_run + vhost_run 0 vhost_json_config 0 $testdir/conf.json notice "" diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index 952d20212..62ecd4e5a 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -245,7 +245,7 @@ if [[ "$ctrl_type" == "kernel_vhost" ]]; then else # Run vhost process and prepare split vbdevs or lvol bdevs notice "running SPDK vhost" - vhost_run + vhost_run 0 notice "..." if [[ $use_split == true ]]; then diff --git a/test/vhost/readonly/readonly.sh b/test/vhost/readonly/readonly.sh index d928f4db9..7ef130540 100755 --- a/test/vhost/readonly/readonly.sh +++ b/test/vhost/readonly/readonly.sh @@ -121,7 +121,7 @@ function blk_ro_tc1() vm_shutdown_all } -vhost_run +vhost_run 0 if [[ -z $x ]]; then set +x fi diff --git a/test/vhost/shared/shared.sh b/test/vhost/shared/shared.sh index d8ce41f05..6198aadff 100755 --- a/test/vhost/shared/shared.sh +++ b/test/vhost/shared/shared.sh @@ -17,7 +17,7 @@ vhosttestinit trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT -vhost_run +vhost_run 0 $rpc_py construct_malloc_bdev -b Malloc 124 4096 $rpc_py construct_vhost_blk_controller Malloc.0 Malloc diff --git a/test/vhost/vhost_boot/vhost_boot.sh b/test/vhost/vhost_boot/vhost_boot.sh index 935195b6d..6ac0de06a 100755 --- a/test/vhost/vhost_boot/vhost_boot.sh +++ b/test/vhost/vhost_boot/vhost_boot.sh @@ -61,7 +61,7 @@ vhosttestinit timing_enter vhost_boot trap 'err_clean "${FUNCNAME}" "${LINENO}"' ERR timing_enter start_vhost -vhost_run +vhost_run 0 timing_exit start_vhost timing_enter create_lvol diff --git a/test/vhost/windows/windows.sh b/test/vhost/windows/windows.sh index d901431e0..a3cec79be 100755 --- a/test/vhost/windows/windows.sh +++ b/test/vhost/windows/windows.sh @@ -84,7 +84,7 @@ vm_kill_all # Violating this rule doesn't cause any issues for SPDK vhost, # but triggers an assert, so we can only run Windows VMs with non-debug SPDK builds. notice "running SPDK vhost" -vhost_run +vhost_run 0 notice "..." # Prepare bdevs for later vhost controllers use diff --git a/test/vhost/windows/windows_scsi_compliance.sh b/test/vhost/windows/windows_scsi_compliance.sh index 3ed147c00..b82a94756 100755 --- a/test/vhost/windows/windows_scsi_compliance.sh +++ b/test/vhost/windows/windows_scsi_compliance.sh @@ -49,7 +49,7 @@ mkdir -p $testdir/results dd if=/dev/zero of=$aio_file bs=1M count=512 timing_enter vhost_run -vhost_run +vhost_run 0 $rpc_py set_bdev_nvme_hotplug -e $rpc_py construct_malloc_bdev 256 4096 -b Malloc0 $rpc_py construct_aio_bdev $aio_file Aio0 512