From 6de97c1a9192f844b8aed7ef4a6b31acb0d3d4b8 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 17 May 2019 14:09:40 -0700 Subject: [PATCH] test/vhost: Add calls to vhosttestinit and vhosttestfini Change-Id: I0b564a6931b91f5226ad6a6909c5285f5cb76a71 Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454944 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- test/vhost/fiotest/fio.sh | 4 ++++ test/vhost/initiator/blockdev.sh | 4 ++++ test/vhost/integrity/integrity_start.sh | 4 ++++ test/vhost/lvol/lvol_test.sh | 4 ++++ test/vhost/migration/migration.sh | 4 ++++ test/vhost/other/negative.sh | 4 ++++ test/vhost/readonly/readonly.sh | 4 ++++ test/vhost/shared/shared.sh | 4 ++++ test/vhost/vhost_boot/vhost_boot.sh | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/test/vhost/fiotest/fio.sh b/test/vhost/fiotest/fio.sh index 56d17121d..0956df950 100755 --- a/test/vhost/fiotest/fio.sh +++ b/test/vhost/fiotest/fio.sh @@ -71,6 +71,8 @@ if [[ ! -r "$fio_job" ]]; then fail "no fio job file specified" fi +vhosttestinit + trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR vm_kill_all @@ -263,3 +265,5 @@ else notice "" notice "===============" fi + +vhosttestfini diff --git a/test/vhost/initiator/blockdev.sh b/test/vhost/initiator/blockdev.sh index ebb89dc12..a9defe9ec 100755 --- a/test/vhost/initiator/blockdev.sh +++ b/test/vhost/initiator/blockdev.sh @@ -41,6 +41,8 @@ while getopts 'h-:' optchar; do esac done +vhosttestinit + source $testdir/autotest.config PLUGIN_DIR=$rootdir/examples/bdev/fio_plugin RPC_PY="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" @@ -203,3 +205,5 @@ $RPC_PY delete_nvme_controller Nvme0 timing_enter spdk_vhost_kill spdk_vhost_kill timing_exit spdk_vhost_kill + +vhosttestfini diff --git a/test/vhost/integrity/integrity_start.sh b/test/vhost/integrity/integrity_start.sh index 7c56e6bc7..125cec0a4 100755 --- a/test/vhost/integrity/integrity_start.sh +++ b/test/vhost/integrity/integrity_start.sh @@ -50,6 +50,8 @@ while getopts 'xh-:' optchar; do esac done +vhosttestinit + . $(readlink -e "$(dirname $0)/../common.sh") || exit 1 rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" @@ -98,3 +100,5 @@ $rpc_py delete_nvme_controller Nvme0 notice "Shutting down SPDK vhost app..." spdk_vhost_kill + +vhosttestfini diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index e5f49ef62..9b024af90 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -98,6 +98,8 @@ while getopts 'xh-:' optchar; do esac done +vhosttestinit + notice "Get NVMe disks:" nvmes=($(iter_pci_class_code 01 08 02)) @@ -282,3 +284,5 @@ $rpc_py get_vhost_controllers notice "Shutting down SPDK vhost app..." spdk_vhost_kill + +vhosttestfini diff --git a/test/vhost/migration/migration.sh b/test/vhost/migration/migration.sh index d822a30a9..0a9e1230d 100755 --- a/test/vhost/migration/migration.sh +++ b/test/vhost/migration/migration.sh @@ -53,6 +53,8 @@ for param in "$@"; do esac done +vhosttestinit + . $(readlink -e "$(dirname $0)/../common.sh") || exit 1 MIGRATION_DIR=$(readlink -f $(dirname $0)) @@ -149,3 +151,5 @@ notice "Migration Test SUCCESS" notice "===============" trap - SIGINT ERR EXIT + +vhosttestfini diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index 3bf28706f..4a762892c 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -32,6 +32,8 @@ while getopts 'xh-:' optchar; do esac done +vhosttestinit + trap error_exit ERR VHOST_APP="$SPDK_BUILD_DIR/app/vhost/vhost" @@ -143,3 +145,5 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then notice "EXIT DONE" notice "===============" fi + +vhosttestfini diff --git a/test/vhost/readonly/readonly.sh b/test/vhost/readonly/readonly.sh index 4b25c240f..9fe868b57 100755 --- a/test/vhost/readonly/readonly.sh +++ b/test/vhost/readonly/readonly.sh @@ -46,6 +46,8 @@ while getopts 'xh-:' optchar; do esac done +vhosttestinit + trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR if [[ $EUID -ne 0 ]]; then @@ -131,3 +133,5 @@ blk_ro_tc1 $rpc_py delete_nvme_controller Nvme0 spdk_vhost_kill + +vhosttestfini diff --git a/test/vhost/shared/shared.sh b/test/vhost/shared/shared.sh index d4457ac0e..10aa69c05 100755 --- a/test/vhost/shared/shared.sh +++ b/test/vhost/shared/shared.sh @@ -17,6 +17,8 @@ function run_spdk_fio() { --spdk_mem=1024 --spdk_single_seg=1 --spdk_conf=$testdir/bdev.conf "$@" } +vhosttestinit + trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT spdk_vhost_run @@ -30,3 +32,5 @@ sleep 1 run_spdk_fio --size=50% --offset=50% --filename=VirtioBlk0 wait $run_fio_pid spdk_vhost_kill + +vhosttestfini diff --git a/test/vhost/vhost_boot/vhost_boot.sh b/test/vhost/vhost_boot/vhost_boot.sh index 3641ec9e6..7068993cd 100755 --- a/test/vhost/vhost_boot/vhost_boot.sh +++ b/test/vhost/vhost_boot/vhost_boot.sh @@ -56,6 +56,8 @@ if [[ -z $os_image ]]; then exit 1 fi +vhosttestinit + timing_enter vhost_boot trap 'err_clean "${FUNCNAME}" "${LINENO}"' ERR timing_enter start_vhost @@ -112,3 +114,5 @@ spdk_vhost_kill timing_exit clean_vhost timing_exit vhost_boot + +vhosttestfini