test/vhost: convert migration tests to run_test

This test suite was doing some things as far as formatting that are
covered by the run_test framework. Also, the way the tet cases were
organized was obfuscating which migration tests are actually being run
in the autotest jobs. This configuration makes it a lot easier to
manage.

As a side note, migration-tc3a.sh and migration-tc3b are not referenced
anywhere in the test scripts. They may be extraneous.

Change-Id: Ibe6782b38cb87c90b2bc61f112f10cd35f5b4a44
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476937
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Seth Howell 2019-12-05 11:44:46 -07:00 committed by Tomasz Zawadzki
parent 6b9e48df95
commit 5854d3c0a5
4 changed files with 6 additions and 24 deletions

View File

@ -119,5 +119,3 @@ function migration_tc1()
notice "Migration TC1 SUCCESS"
}
migration_tc1

View File

@ -204,5 +204,3 @@ function migration_tc2()
migration_tc2_cleanup_vhost_config
notice "Migration TC2 SUCCESS"
}
migration_tc2

View File

@ -4,6 +4,9 @@ testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/vhost/common.sh
source $testdir/migration-tc1.sh
source $testdir/migration-tc2.sh
vms=()
declare -A vms_os
@ -13,7 +16,6 @@ declare -A vms_ctrlrs_disks
# By default use Guest fio
fio_bin=""
test_cases=""
MGMT_TARGET_IP=""
MGMT_INITIATOR_IP=""
RDMA_TARGET_IP=""
@ -26,8 +28,6 @@ function usage()
echo
echo " --os ARGS VM configuration. This parameter might be used more than once:"
echo " --fio-bin=FIO Use specific fio binary (will be uploaded to VM)"
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 " --mgmt-tgt-ip=IP IP address of target."
echo " --mgmt-init-ip=IP IP address of initiator."
echo " --rdma-tgt-ip=IP IP address of targets rdma capable NIC."
@ -43,7 +43,6 @@ for param in "$@"; do
;;
--os=*) os_image="${param#*=}" ;;
--fio-bin=*) fio_bin="${param}" ;;
--test-cases=*) test_cases="${param#*=}" ;;
--mgmt-tgt-ip=*) MGMT_TARGET_IP="${param#*=}" ;;
--mgmt-init-ip=*) MGMT_INITIATOR_IP="${param#*=}" ;;
--rdma-tgt-ip=*) RDMA_TARGET_IP="${param#*=}" ;;
@ -58,8 +57,6 @@ done
vhosttestinit
[[ -n "$test_cases" ]] || fail "Need '--test-cases=' parameter"
trap 'error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
function vm_monitor_send()
@ -139,19 +136,8 @@ function is_fio_running()
return $ret
}
for test_case in ${test_cases//,/ }; do
assert_number "$test_case"
notice "==============================="
notice "Running Migration test case ${test_case}"
notice "==============================="
timing_enter migration-tc${test_case}
source $testdir/migration-tc${test_case}.sh
timing_exit migration-tc${test_case}
done
notice "Migration Test SUCCESS"
notice "==============="
run_test "case" "vhost_migration_tc1" migration_tc1
run_test "case" "vhost_migration_tc2" migration_tc2
trap - SIGINT ERR EXIT

View File

@ -100,7 +100,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
echo 'Running migration suite...'
run_test case "vhost_migration" $WORKDIR/migration/migration.sh -x \
--fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1,2
--fio-bin=$FIO_BIN --os=$VM_IMAGE
fi
echo 'Running lvol integrity suite...'