test/vhost: Allow string names for vhost targets
Don't require these to be numbered. Change-Id: I385f579b41d24eea02e157e53c4fc1530864bb5b Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461389 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
cefe9145e4
commit
fa563858fa
@ -133,6 +133,6 @@ truncate -s 400M $testdir/aio_bdev_0 $testdir/aio_bdev_1
|
|||||||
vhost_start
|
vhost_start
|
||||||
$testdir/lvol_test.py $rpc_py $total_size $block_size $testdir $rootdir/app/vhost "${test_cases[@]}"
|
$testdir/lvol_test.py $rpc_py $total_size $block_size $testdir $rootdir/app/vhost "${test_cases[@]}"
|
||||||
|
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
rm -rf $testdir/aio_bdev_0 $testdir/aio_bdev_1
|
rm -rf $testdir/aio_bdev_0 $testdir/aio_bdev_1
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
|
@ -53,7 +53,7 @@ $VHOST_RPC construct_vhost_scsi_controller naa.VhostScsi0.3
|
|||||||
$VHOST_RPC add_vhost_scsi_lun naa.VhostScsi0.3 0 "Nvme0n1"
|
$VHOST_RPC add_vhost_scsi_lun naa.VhostScsi0.3 0 "Nvme0n1"
|
||||||
|
|
||||||
# start qemu based VM.
|
# start qemu based VM.
|
||||||
vm_setup --os="$VM_IMAGE" --disk-type=spdk_vhost_scsi --disks="VhostScsi0" --force=3 --vhost-num=3
|
vm_setup --os="$VM_IMAGE" --disk-type=spdk_vhost_scsi --disks="VhostScsi0" --force=3 --vhost-name=3
|
||||||
|
|
||||||
vm_run 3
|
vm_run 3
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ function error()
|
|||||||
echo -e "ERROR: $1"
|
echo -e "ERROR: $1"
|
||||||
echo "error code: $error_code"
|
echo "error code: $error_code"
|
||||||
echo "==========="
|
echo "==========="
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
pmem_clean_pool_file
|
pmem_clean_pool_file
|
||||||
return $error_code
|
return $error_code
|
||||||
}
|
}
|
||||||
|
@ -698,5 +698,5 @@ fi
|
|||||||
|
|
||||||
pmem_clean_pool_file
|
pmem_clean_pool_file
|
||||||
report_test_completion "pmem"
|
report_test_completion "pmem"
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
timing_exit pmem
|
timing_exit pmem
|
||||||
|
@ -96,42 +96,34 @@ function notice()
|
|||||||
|
|
||||||
function get_vhost_dir()
|
function get_vhost_dir()
|
||||||
{
|
{
|
||||||
if [[ ! -z "$1" ]]; then
|
local vhost_name="$1"
|
||||||
assert_number "$1"
|
|
||||||
local vhost_num=$1
|
if [[ -z "$vhost_name" ]]; then
|
||||||
else
|
error "vhost name must be provided to get_vhost_dir"
|
||||||
local vhost_num=0
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$TARGET_DIR/${vhost_num}"
|
echo "$TARGET_DIR/${vhost_name}"
|
||||||
}
|
|
||||||
|
|
||||||
function vhost_list_all()
|
|
||||||
{
|
|
||||||
shopt -s nullglob
|
|
||||||
local vhost_list="$(echo $TARGET_DIR/[0-9]*)"
|
|
||||||
shopt -u nullglob
|
|
||||||
|
|
||||||
if [[ ! -z "$vhost_list" ]]; then
|
|
||||||
vhost_list="$(basename --multiple $vhost_list)"
|
|
||||||
echo "${vhost_list//vhost/}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function vhost_run()
|
function vhost_run()
|
||||||
{
|
{
|
||||||
local vhost_num="$1"
|
local vhost_name="$1"
|
||||||
|
|
||||||
assert_number "$vhost_num"
|
|
||||||
shift
|
shift
|
||||||
|
|
||||||
local vhost_dir="$(get_vhost_dir $vhost_num)"
|
if [[ -z "$vhost_name" ]]; then
|
||||||
|
error "vhost name must be provided to vhost_run"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local vhost_dir="$(get_vhost_dir $vhost_name)"
|
||||||
local vhost_app="$rootdir/app/vhost/vhost"
|
local vhost_app="$rootdir/app/vhost/vhost"
|
||||||
local vhost_log_file="$vhost_dir/vhost.log"
|
local vhost_log_file="$vhost_dir/vhost.log"
|
||||||
local vhost_pid_file="$vhost_dir/vhost.pid"
|
local vhost_pid_file="$vhost_dir/vhost.pid"
|
||||||
local vhost_socket="$vhost_dir/usvhost"
|
local vhost_socket="$vhost_dir/usvhost"
|
||||||
notice "starting vhost app in background"
|
notice "starting vhost app in background"
|
||||||
[[ -r "$vhost_pid_file" ]] && vhost_kill $vhost_num
|
[[ -r "$vhost_pid_file" ]] && vhost_kill 0 $vhost_name
|
||||||
[[ -d $vhost_dir ]] && rm -f $vhost_dir/*
|
[[ -d $vhost_dir ]] && rm -f $vhost_dir/*
|
||||||
mkdir -p $vhost_dir
|
mkdir -p $vhost_dir
|
||||||
|
|
||||||
@ -175,13 +167,14 @@ function vhost_load_config()
|
|||||||
function vhost_kill()
|
function vhost_kill()
|
||||||
{
|
{
|
||||||
local rc=0
|
local rc=0
|
||||||
local vhost_num=0
|
local vhost_name="$1"
|
||||||
if [[ ! -z "$1" ]]; then
|
|
||||||
vhost_num=$1
|
if [[ -z "$vhost_name" ]]; then
|
||||||
assert_number "$vhost_num"
|
error "Must provide vhost name to vhost_kill"
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local vhost_pid_file="$(get_vhost_dir $vhost_num)/vhost.pid"
|
local vhost_pid_file="$(get_vhost_dir $vhost_name)/vhost.pid"
|
||||||
|
|
||||||
if [[ ! -r $vhost_pid_file ]]; then
|
if [[ ! -r $vhost_pid_file ]]; then
|
||||||
warning "no vhost pid file found"
|
warning "no vhost pid file found"
|
||||||
@ -229,14 +222,15 @@ function vhost_kill()
|
|||||||
|
|
||||||
function vhost_rpc
|
function vhost_rpc
|
||||||
{
|
{
|
||||||
local vhost_num=0
|
local vhost_name="$1"
|
||||||
if [[ ! -z "$1" ]]; then
|
|
||||||
vhost_num=$1
|
if [[ -z "$vhost_name" ]]; then
|
||||||
assert_number "$vhost_num"
|
error "vhost name must be provided to vhost_rpc"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
|
|
||||||
$rootdir/scripts/rpc.py -s $(get_vhost_dir $vhost_num)/rpc.sock $@
|
$rootdir/scripts/rpc.py -s $(get_vhost_dir $vhost_name)/rpc.sock $@
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
@ -521,7 +515,7 @@ function vm_setup()
|
|||||||
local force_vm=""
|
local force_vm=""
|
||||||
local guest_memory=1024
|
local guest_memory=1024
|
||||||
local queue_number=""
|
local queue_number=""
|
||||||
local vhost_dir="$(get_vhost_dir)"
|
local vhost_dir="$(get_vhost_dir 0)"
|
||||||
while getopts ':-:' optchar; do
|
while getopts ':-:' optchar; do
|
||||||
case "$optchar" in
|
case "$optchar" in
|
||||||
-)
|
-)
|
||||||
@ -538,7 +532,7 @@ function vm_setup()
|
|||||||
queue_num=*) local queue_number=${OPTARG#*=} ;;
|
queue_num=*) local queue_number=${OPTARG#*=} ;;
|
||||||
incoming=*) local vm_incoming="${OPTARG#*=}" ;;
|
incoming=*) local vm_incoming="${OPTARG#*=}" ;;
|
||||||
migrate-to=*) local vm_migrate_to="${OPTARG#*=}" ;;
|
migrate-to=*) local vm_migrate_to="${OPTARG#*=}" ;;
|
||||||
vhost-num=*) local vhost_dir="$(get_vhost_dir ${OPTARG#*=})" ;;
|
vhost-name=*) local vhost_dir="$(get_vhost_dir ${OPTARG#*=})" ;;
|
||||||
spdk-boot=*) local boot_from="${OPTARG#*=}" ;;
|
spdk-boot=*) local boot_from="${OPTARG#*=}" ;;
|
||||||
*)
|
*)
|
||||||
error "unknown argument $OPTARG"
|
error "unknown argument $OPTARG"
|
||||||
@ -1097,7 +1091,7 @@ function run_fio()
|
|||||||
#
|
#
|
||||||
function at_app_exit()
|
function at_app_exit()
|
||||||
{
|
{
|
||||||
local vhost_num
|
local vhost_name
|
||||||
|
|
||||||
notice "APP EXITING"
|
notice "APP EXITING"
|
||||||
notice "killing all VMs"
|
notice "killing all VMs"
|
||||||
@ -1105,8 +1099,8 @@ function at_app_exit()
|
|||||||
# Kill vhost application
|
# Kill vhost application
|
||||||
notice "killing vhost app"
|
notice "killing vhost app"
|
||||||
|
|
||||||
for vhost_num in $(vhost_list_all); do
|
for vhost_name in $(ls $TARGET_DIR); do
|
||||||
vhost_kill $vhost_num
|
vhost_kill $vhost_name
|
||||||
done
|
done
|
||||||
|
|
||||||
notice "EXIT DONE"
|
notice "EXIT DONE"
|
||||||
|
@ -91,7 +91,7 @@ notice ""
|
|||||||
notice "Setting up VM"
|
notice "Setting up VM"
|
||||||
notice ""
|
notice ""
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
for vm_conf in ${vms[@]}; do
|
for vm_conf in ${vms[@]}; do
|
||||||
IFS=',' read -ra conf <<< "$vm_conf"
|
IFS=',' read -ra conf <<< "$vm_conf"
|
||||||
@ -254,7 +254,7 @@ if ! $no_shutdown; then
|
|||||||
fi
|
fi
|
||||||
notice "Testing done -> shutting down"
|
notice "Testing done -> shutting down"
|
||||||
notice "killing vhost app"
|
notice "killing vhost app"
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
notice "EXIT DONE"
|
notice "EXIT DONE"
|
||||||
notice "==============="
|
notice "==============="
|
||||||
|
@ -65,7 +65,7 @@ fio_job=$testdir/fio_jobs/default_integrity.job
|
|||||||
tmp_attach_job=$testdir/fio_jobs/fio_attach.job.tmp
|
tmp_attach_job=$testdir/fio_jobs/fio_attach.job.tmp
|
||||||
tmp_detach_job=$testdir/fio_jobs/fio_detach.job.tmp
|
tmp_detach_job=$testdir/fio_jobs/fio_detach.job.tmp
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
function print_test_fio_header() {
|
function print_test_fio_header() {
|
||||||
notice "==============="
|
notice "==============="
|
||||||
@ -181,7 +181,7 @@ function reboot_all_and_prepare() {
|
|||||||
|
|
||||||
function post_test_case() {
|
function post_test_case() {
|
||||||
vm_shutdown_all
|
vm_shutdown_all
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function on_error_exit() {
|
function on_error_exit() {
|
||||||
|
@ -37,7 +37,7 @@ vhosttestinit
|
|||||||
|
|
||||||
source $testdir/autotest.config
|
source $testdir/autotest.config
|
||||||
PLUGIN_DIR=$rootdir/examples/bdev/fio_plugin
|
PLUGIN_DIR=$rootdir/examples/bdev/fio_plugin
|
||||||
RPC_PY="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
RPC_PY="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
if [ ! -x $FIO_PATH ]; then
|
if [ ! -x $FIO_PATH ]; then
|
||||||
error "Invalid path of fio binary"
|
error "Invalid path of fio binary"
|
||||||
@ -50,6 +50,7 @@ fi
|
|||||||
|
|
||||||
trap 'rm -f *.state $rootdir/spdk.tar.gz $rootdir/fio.tar.gz $(get_vhost_dir)/Virtio0;\
|
trap 'rm -f *.state $rootdir/spdk.tar.gz $rootdir/fio.tar.gz $(get_vhost_dir)/Virtio0;\
|
||||||
error_exit "${FUNCNAME}""${LINENO}"' ERR SIGTERM SIGABRT
|
error_exit "${FUNCNAME}""${LINENO}"' ERR SIGTERM SIGABRT
|
||||||
|
|
||||||
function run_spdk_fio() {
|
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
|
||||||
}
|
}
|
||||||
@ -109,7 +110,7 @@ timing_exit run_spdk_fio_unmap
|
|||||||
$RPC_PY delete_nvme_controller Nvme0
|
$RPC_PY delete_nvme_controller Nvme0
|
||||||
|
|
||||||
timing_enter vhost_kill
|
timing_enter vhost_kill
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
timing_exit vhost_kill
|
timing_exit vhost_kill
|
||||||
|
|
||||||
vhosttestfini
|
vhosttestfini
|
||||||
|
@ -52,7 +52,7 @@ done
|
|||||||
vhosttestinit
|
vhosttestinit
|
||||||
|
|
||||||
. $(readlink -e "$(dirname $0)/../common.sh") || exit 1
|
. $(readlink -e "$(dirname $0)/../common.sh") || exit 1
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR
|
||||||
|
|
||||||
@ -98,6 +98,6 @@ clean_lvol_cfg
|
|||||||
$rpc_py delete_nvme_controller Nvme0
|
$rpc_py delete_nvme_controller Nvme0
|
||||||
|
|
||||||
notice "Shutting down SPDK vhost app..."
|
notice "Shutting down SPDK vhost app..."
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
vhosttestfini
|
vhosttestfini
|
||||||
|
@ -6,7 +6,7 @@ source $rootdir/test/common/autotest_common.sh
|
|||||||
source $rootdir/test/vhost/common.sh
|
source $rootdir/test/vhost/common.sh
|
||||||
source $rootdir/scripts/common.sh
|
source $rootdir/scripts/common.sh
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
vm_count=1
|
vm_count=1
|
||||||
max_disks=""
|
max_disks=""
|
||||||
@ -282,6 +282,6 @@ $rpc_py get_bdevs
|
|||||||
$rpc_py get_vhost_controllers
|
$rpc_py get_vhost_controllers
|
||||||
|
|
||||||
notice "Shutting down SPDK vhost app..."
|
notice "Shutting down SPDK vhost app..."
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
vhosttestfini
|
vhosttestfini
|
||||||
|
@ -21,7 +21,7 @@ function migration_tc1_configure_vhost()
|
|||||||
target_vm=1
|
target_vm=1
|
||||||
incoming_vm_ctrlr=naa.Malloc0.$incoming_vm
|
incoming_vm_ctrlr=naa.Malloc0.$incoming_vm
|
||||||
target_vm_ctrlr=naa.Malloc0.$target_vm
|
target_vm_ctrlr=naa.Malloc0.$target_vm
|
||||||
rpc="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
trap 'migration_tc1_error_handler; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
|
trap 'migration_tc1_error_handler; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ function migration_tc1()
|
|||||||
migration_tc1_clean_vhost_config
|
migration_tc1_clean_vhost_config
|
||||||
|
|
||||||
notice "killing vhost app"
|
notice "killing vhost app"
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
notice "Migration TC1 SUCCESS"
|
notice "Migration TC1 SUCCESS"
|
||||||
}
|
}
|
||||||
|
@ -129,9 +129,9 @@ function migration_tc2_configure_vhost()
|
|||||||
|
|
||||||
notice "Setting up VMs"
|
notice "Setting up VMs"
|
||||||
vm_setup --os="$os_image" --force=$incoming_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 \
|
vm_setup --os="$os_image" --force=$incoming_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 \
|
||||||
--migrate-to=$target_vm --memory=1024 --vhost-num=0
|
--migrate-to=$target_vm --memory=1024 --vhost-name=0
|
||||||
vm_setup --force=$target_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 --incoming=$incoming_vm --memory=1024 \
|
vm_setup --force=$target_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 --incoming=$incoming_vm --memory=1024 \
|
||||||
--vhost-num=1
|
--vhost-name=1
|
||||||
|
|
||||||
# Run everything
|
# Run everything
|
||||||
vm_run $incoming_vm $target_vm
|
vm_run $incoming_vm $target_vm
|
||||||
|
@ -40,7 +40,7 @@ function host_2_start_vhost()
|
|||||||
$rpc add_vhost_scsi_lun $target_vm_ctrl 0 Nvme0n1
|
$rpc add_vhost_scsi_lun $target_vm_ctrl 0 Nvme0n1
|
||||||
|
|
||||||
vm_setup --os="$os_image" --force=$target_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 \
|
vm_setup --os="$os_image" --force=$target_vm --disk-type=spdk_vhost_scsi --disks=VhostScsi0 \
|
||||||
--memory=512 --vhost-num=1 --incoming=$incoming_vm
|
--memory=512 --vhost-name=1 --incoming=$incoming_vm
|
||||||
vm_run $target_vm
|
vm_run $target_vm
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then
|
|||||||
vhost_json_config 0 $testdir/conf.json
|
vhost_json_config 0 $testdir/conf.json
|
||||||
notice ""
|
notice ""
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
# General commands
|
# General commands
|
||||||
notice "Trying to remove nonexistent controller"
|
notice "Trying to remove nonexistent controller"
|
||||||
@ -142,7 +142,7 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then
|
|||||||
|
|
||||||
notice "Testing done -> shutting down"
|
notice "Testing done -> shutting down"
|
||||||
notice "killing vhost app"
|
notice "killing vhost app"
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
notice "EXIT DONE"
|
notice "EXIT DONE"
|
||||||
notice "==============="
|
notice "==============="
|
||||||
|
@ -139,7 +139,7 @@ while getopts 'xh-:' optchar; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
if [[ -n $custom_cpu_cfg ]]; then
|
if [[ -n $custom_cpu_cfg ]]; then
|
||||||
source $custom_cpu_cfg
|
source $custom_cpu_cfg
|
||||||
@ -386,7 +386,7 @@ else
|
|||||||
else
|
else
|
||||||
cleanup_lvol_cfg
|
cleanup_lvol_cfg
|
||||||
fi
|
fi
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$kernel_cpus" ]]; then
|
if [[ -n "$kernel_cpus" ]]; then
|
||||||
|
@ -5,7 +5,7 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/vhost/common.sh
|
source $rootdir/test/vhost/common.sh
|
||||||
|
|
||||||
rpc_py="$testdir/../../../scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$testdir/../../../scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
vm_img=""
|
vm_img=""
|
||||||
disk="Nvme0n1"
|
disk="Nvme0n1"
|
||||||
@ -130,6 +130,6 @@ blk_ro_tc1
|
|||||||
|
|
||||||
$rpc_py delete_nvme_controller Nvme0
|
$rpc_py delete_nvme_controller Nvme0
|
||||||
|
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
vhosttestfini
|
vhosttestfini
|
||||||
|
@ -5,7 +5,7 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/vhost/common.sh
|
source $rootdir/test/vhost/common.sh
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
function run_spdk_fio() {
|
function run_spdk_fio() {
|
||||||
fio_bdev --ioengine=spdk_bdev \
|
fio_bdev --ioengine=spdk_bdev \
|
||||||
@ -27,6 +27,6 @@ run_fio_pid=$!
|
|||||||
sleep 1
|
sleep 1
|
||||||
run_spdk_fio --size=50% --offset=50% --filename=VirtioBlk0
|
run_spdk_fio --size=50% --offset=50% --filename=VirtioBlk0
|
||||||
wait $run_fio_pid
|
wait $run_fio_pid
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
vhosttestfini
|
vhosttestfini
|
||||||
|
@ -7,7 +7,7 @@ source $rootdir/test/common/autotest_common.sh
|
|||||||
source $rootdir/test/vhost/common.sh
|
source $rootdir/test/vhost/common.sh
|
||||||
source $rootdir/test/bdev/nbd_common.sh
|
source $rootdir/test/bdev/nbd_common.sh
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
vm_no="0"
|
vm_no="0"
|
||||||
|
|
||||||
function err_clean
|
function err_clean
|
||||||
@ -21,7 +21,7 @@ function err_clean
|
|||||||
$rpc_py remove_vhost_controller naa.vhost_vm.$vm_no
|
$rpc_py remove_vhost_controller naa.vhost_vm.$vm_no
|
||||||
$rpc_py destroy_lvol_bdev $lvb_u
|
$rpc_py destroy_lvol_bdev $lvb_u
|
||||||
$rpc_py destroy_lvol_store -u $lvs_u
|
$rpc_py destroy_lvol_store -u $lvs_u
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ timing_exit create_lvol
|
|||||||
|
|
||||||
timing_enter convert_vm_image
|
timing_enter convert_vm_image
|
||||||
modprobe nbd
|
modprobe nbd
|
||||||
trap 'nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0; err_clean "${FUNCNAME}" "${LINENO}"' ERR
|
trap 'nbd_stop_disks $(get_vhost_dir 0)/rpc.sock /dev/nbd0; err_clean "${FUNCNAME}" "${LINENO}"' ERR
|
||||||
nbd_start_disks "$(get_vhost_dir)/rpc.sock" $lvb_u /dev/nbd0
|
nbd_start_disks "$(get_vhost_dir 0)/rpc.sock" $lvb_u /dev/nbd0
|
||||||
qemu-img convert $os_image -O raw /dev/nbd0
|
qemu-img convert $os_image -O raw /dev/nbd0
|
||||||
sync
|
sync
|
||||||
nbd_stop_disks $(get_vhost_dir)/rpc.sock /dev/nbd0
|
nbd_stop_disks $(get_vhost_dir 0)/rpc.sock /dev/nbd0
|
||||||
sleep 1
|
sleep 1
|
||||||
timing_exit convert_vm_image
|
timing_exit convert_vm_image
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ $rpc_py remove_vhost_scsi_target naa.vhost_vm.$vm_no 0
|
|||||||
$rpc_py remove_vhost_controller naa.vhost_vm.$vm_no
|
$rpc_py remove_vhost_controller naa.vhost_vm.$vm_no
|
||||||
$rpc_py destroy_lvol_bdev $lvb_u
|
$rpc_py destroy_lvol_bdev $lvb_u
|
||||||
$rpc_py destroy_lvol_store -u $lvs_u
|
$rpc_py destroy_lvol_store -u $lvs_u
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
timing_exit clean_vhost
|
timing_exit clean_vhost
|
||||||
|
|
||||||
timing_exit vhost_boot
|
timing_exit vhost_boot
|
||||||
|
@ -5,7 +5,7 @@ rootdir=$(readlink -f $testdir/../../..)
|
|||||||
source $rootdir/test/common/autotest_common.sh
|
source $rootdir/test/common/autotest_common.sh
|
||||||
source $rootdir/test/vhost/common.sh
|
source $rootdir/test/vhost/common.sh
|
||||||
|
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
ctrl_type="spdk_vhost_scsi"
|
ctrl_type="spdk_vhost_scsi"
|
||||||
ssh_pass=""
|
ssh_pass=""
|
||||||
vm_num="0"
|
vm_num="0"
|
||||||
@ -132,6 +132,6 @@ notice "Shutting down Windows VM..."
|
|||||||
vm_kill $vm_num
|
vm_kill $vm_num
|
||||||
|
|
||||||
notice "Shutting down SPDK vhost app..."
|
notice "Shutting down SPDK vhost app..."
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
|
|
||||||
rm -f $aio_file
|
rm -f $aio_file
|
||||||
|
@ -14,7 +14,7 @@ aio_file="$testdir/aio_disk"
|
|||||||
ssh_pass=""
|
ssh_pass=""
|
||||||
vm_num=1
|
vm_num=1
|
||||||
keep_results_dir=false
|
keep_results_dir=false
|
||||||
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
||||||
|
|
||||||
function usage()
|
function usage()
|
||||||
{
|
{
|
||||||
@ -76,7 +76,7 @@ dos2unix $testdir/results/WIN_SCSI_*.log
|
|||||||
notice "Kill vm 1"
|
notice "Kill vm 1"
|
||||||
vm_kill "$vm_num"
|
vm_kill "$vm_num"
|
||||||
notice "Kill spdk"
|
notice "Kill spdk"
|
||||||
vhost_kill
|
vhost_kill 0
|
||||||
notice "Remove $aio_file"
|
notice "Remove $aio_file"
|
||||||
rm -f $aio_file
|
rm -f $aio_file
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user