From 473007425e7086cd9d1a5d05749f9aff47200707 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Fri, 27 Mar 2020 12:51:50 +0100 Subject: [PATCH] test/vhost/initiator: don't use test/vhost/common.sh That common.sh requires e.g. qemu installed, which is completely unnecessary for this test. vhost_kill() used to clean up e.g. leftover fio files, but now instead of deleting them, just tell FIO not to create them by using --verify_state_save=0 fio param. Change-Id: I5e63dad5681e715ee5dac131ec9b5c17bfdac2eb Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1550 Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- test/vhost/initiator/blockdev.sh | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/test/vhost/initiator/blockdev.sh b/test/vhost/initiator/blockdev.sh index 86e87788c..9ae7a4e5a 100755 --- a/test/vhost/initiator/blockdev.sh +++ b/test/vhost/initiator/blockdev.sh @@ -3,20 +3,18 @@ testdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $testdir/../../..) source $rootdir/test/common/autotest_common.sh -source $rootdir/test/vhost/common.sh -vhosttestinit - -source $testdir/autotest.config -RPC_PY="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" +RPC_PY="$rootdir/scripts/rpc.py" function run_spdk_fio() { - fio_bdev --ioengine=spdk_bdev "$@" --spdk_mem=1024 --spdk_single_seg=1 + fio_bdev --ioengine=spdk_bdev "$@" --spdk_mem=1024 --spdk_single_seg=1 \ + --verify_state_save=0 } function create_bdev_config() { + $rootdir/scripts/gen_nvme.sh --json | $RPC_PY load_subsystem_config if [ -z "$($RPC_PY bdev_get_bdevs | jq '.[] | select(.name=="Nvme0n1")')" ]; then - error "Nvme0n1 bdev not found!" + echo "Nvme0n1 bdev not found!" && false fi $RPC_PY bdev_split_create Nvme0n1 6 @@ -41,18 +39,16 @@ function create_bdev_config() { function err_cleanup() { rm -f $testdir/bdev.json - vhost_kill 0 + killprocess $vhost_pid if [[ -n "$dummy_spdk_pid" ]] && kill -0 $dummy_spdk_pid &> /dev/null; then killprocess $dummy_spdk_pid fi - vhosttestfini } -timing_enter vhost_run -vhost_run 0 -timing_exit vhost_run - trap 'err_cleanup; exit 1' SIGINT SIGTERM EXIT +$rootdir/app/vhost/vhost & +vhost_pid=$! +waitforlisten $vhost_pid timing_enter create_bdev_config create_bdev_config @@ -90,8 +86,4 @@ $RPC_PY bdev_nvme_detach_controller Nvme0 trap - SIGINT SIGTERM EXIT rm -f $testdir/bdev.json -timing_enter vhost_kill -vhost_kill 0 -timing_exit vhost_kill - -vhosttestfini +killprocess $vhost_pid