From 5854d3c0a5d33c72df6b49ca47146f9973afd9fb Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 5 Dec 2019 11:44:46 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476937 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Community-CI: SPDK CI Jenkins --- test/vhost/migration/migration-tc1.sh | 2 -- test/vhost/migration/migration-tc2.sh | 2 -- test/vhost/migration/migration.sh | 24 +++++------------------- test/vhost/vhost.sh | 2 +- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/test/vhost/migration/migration-tc1.sh b/test/vhost/migration/migration-tc1.sh index 6c4e2e5df..9bf54e0d6 100644 --- a/test/vhost/migration/migration-tc1.sh +++ b/test/vhost/migration/migration-tc1.sh @@ -119,5 +119,3 @@ function migration_tc1() notice "Migration TC1 SUCCESS" } - -migration_tc1 diff --git a/test/vhost/migration/migration-tc2.sh b/test/vhost/migration/migration-tc2.sh index 421c1e568..05f153d4f 100644 --- a/test/vhost/migration/migration-tc2.sh +++ b/test/vhost/migration/migration-tc2.sh @@ -204,5 +204,3 @@ function migration_tc2() migration_tc2_cleanup_vhost_config notice "Migration TC2 SUCCESS" } - -migration_tc2 diff --git a/test/vhost/migration/migration.sh b/test/vhost/migration/migration.sh index 4180ef337..884f9404e 100755 --- a/test/vhost/migration/migration.sh +++ b/test/vhost/migration/migration.sh @@ -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 diff --git a/test/vhost/vhost.sh b/test/vhost/vhost.sh index d75a24db0..84bf39012 100755 --- a/test/vhost/vhost.sh +++ b/test/vhost/vhost.sh @@ -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...'