From 42d3ea49d4afd51c038169ebbe7c8a4eb4a335b6 Mon Sep 17 00:00:00 2001 From: Pawel Wodkowski Date: Wed, 31 Jan 2018 16:10:26 +0100 Subject: [PATCH] test/vhost: add '--test-cases' parameter for migration As a preparation for implementing next test cases. Change-Id: I6f2d8e94ffe168ff42f70d8fcd4cc127e54fccd3 Signed-off-by: Pawel Wodkowski Reviewed-on: https://review.gerrithub.io/398751 Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- test/vhost/migration/migration.sh | 14 +++++++++++++- test/vhost/spdk_vhost.sh | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/vhost/migration/migration.sh b/test/vhost/migration/migration.sh index 33af8d56ce..f4891ad00e 100755 --- a/test/vhost/migration/migration.sh +++ b/test/vhost/migration/migration.sh @@ -10,6 +10,7 @@ declare -A vms_ctrlrs_disks # By default use Guest fio fio_bin="" +test_cases="" function usage() { @@ -26,6 +27,8 @@ function usage() echo " incoming - set this VM to wait for incoming migration" echo " If test-type=spdk_vhost_blk then each disk size is 20G e.g." echo " --vm num=X,os=os.qcow,bdevs=Malloc0:Nvme0n1:Malloc1" + echo " --test-cases=TESTS Coma-separated list of tests to run. Implemented test cases are: 1" + echo " See test/vhost/test_plan.md for more info." echo "-x set -x for script debug" } @@ -38,6 +41,7 @@ for param in "$@"; do --work-dir=*) TEST_DIR="${param#*=}" ;; --os=*) os_image="${param#*=}" ;; --fio-bin=*) fio_bin="${param}" ;; + --test-cases=*) test_cases="${param#*=}" ;; -x) set -x ;; -v) SPDK_VHOST_VERBOSE=true ;; *) @@ -48,6 +52,8 @@ done . $(readlink -e "$(dirname $0)/../common/common.sh") || exit 1 +[[ ! -z "$test_cases" ]] || fail "Need '--test-cases=' parameter" + trap 'error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT function vm_monitor_send() @@ -115,7 +121,13 @@ function is_fio_running() # FIXME: this shoul'd not be needed vm_kill_all -source $BASE_DIR/migration-tc1.sh +for test_case in ${test_cases//,/ }; do + assert_number "$test_case" + notice "===============================" + notice "Running Migration test case ${test_case}" + notice "===============================" + source $BASE_DIR/migration-tc${test_case}.sh +done notice "Migration Test SUCCESS" notice "===============" diff --git a/test/vhost/spdk_vhost.sh b/test/vhost/spdk_vhost.sh index fdfd21adc5..e18395a7a3 100755 --- a/test/vhost/spdk_vhost.sh +++ b/test/vhost/spdk_vhost.sh @@ -78,7 +78,7 @@ case $1 in -m|--migration) echo 'Running migration suite...' $WORKDIR/migration/migration.sh -x \ - --fio-bin=$FIO_BIN --os=$VM_IMAGE + --fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1 ;; -i|--integrity) echo 'Running SCSI integrity suite...'