diff --git a/test/vhost/common.sh b/test/vhost/common.sh index 504330dd9e..07d4e410bf 100644 --- a/test/vhost/common.sh +++ b/test/vhost/common.sh @@ -3,9 +3,7 @@ set -e : ${SPDK_VHOST_VERBOSE=false} : ${QEMU_PREFIX="/usr/local/qemu/spdk-3.0.0"} -SPDK_BUILD_DIR=$rootdir - -TEST_DIR=$(readlink -f $SPDK_BUILD_DIR/..) +TEST_DIR=$(readlink -f $rootdir/..) SPDK_VHOST_SCSI_TEST_DIR=$TEST_DIR/vhost @@ -132,7 +130,7 @@ function spdk_vhost_run() done local vhost_dir="$(get_vhost_dir $vhost_num)" - local vhost_app="$SPDK_BUILD_DIR/app/vhost/vhost" + local vhost_app="$rootdir/app/vhost/vhost" local vhost_log_file="$vhost_dir/vhost.log" local vhost_pid_file="$vhost_dir/vhost.pid" local vhost_socket="$vhost_dir/usvhost" @@ -162,7 +160,7 @@ function spdk_vhost_run() local cmd="$vhost_app -m $reactor_mask -p $master_core -s $memory -r $vhost_dir/rpc.sock $no_pci" if [[ -n "$vhost_conf_path" ]]; then cp $vhost_conf_template $vhost_conf_file - $SPDK_BUILD_DIR/scripts/gen_nvme.sh >> $vhost_conf_file + $rootdir/scripts/gen_nvme.sh >> $vhost_conf_file cmd="$vhost_app -m $reactor_mask -p $master_core -c $vhost_conf_file -s $memory -r $vhost_dir/rpc.sock $no_pci" fi @@ -179,12 +177,12 @@ function spdk_vhost_run() waitforlisten "$vhost_pid" "$vhost_dir/rpc.sock" #do not generate nvmes if pci access is disabled if [[ -z "$vhost_conf_path" ]] && [[ -z "$no_pci" ]]; then - $SPDK_BUILD_DIR/scripts/gen_nvme.sh "--json" | $SPDK_BUILD_DIR/scripts/rpc.py\ + $rootdir/scripts/gen_nvme.sh "--json" | $rootdir/scripts/rpc.py\ -s $vhost_dir/rpc.sock load_subsystem_config fi if [[ -n "$vhost_json_path" ]]; then - $SPDK_BUILD_DIR/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_path/conf.json" + $rootdir/scripts/rpc.py -s $vhost_dir/rpc.sock load_config < "$vhost_json_path/conf.json" fi notice "vhost started - pid=$vhost_pid" @@ -1115,7 +1113,7 @@ function run_fio() return 0 fi - $SPDK_BUILD_DIR/test/vhost/common/run_fio.py --job-file=/root/$job_fname \ + $rootdir/test/vhost/common/run_fio.py --job-file=/root/$job_fname \ $([[ ! -z "$fio_bin" ]] && echo "--fio-bin=$fio_bin") \ --out=$out $json ${fio_disks%,} } diff --git a/test/vhost/fiotest/fio.sh b/test/vhost/fiotest/fio.sh index 0956df9509..b54d5d05df 100755 --- a/test/vhost/fiotest/fio.sh +++ b/test/vhost/fiotest/fio.sh @@ -91,7 +91,7 @@ notice "" notice "Setting up VM" notice "" -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" for vm_conf in ${vms[@]}; do IFS=',' read -ra conf <<< "$vm_conf" diff --git a/test/vhost/hotplug/common.sh b/test/vhost/hotplug/common.sh index f1e0e6a694..d159f3bdf3 100644 --- a/test/vhost/hotplug/common.sh +++ b/test/vhost/hotplug/common.sh @@ -65,7 +65,7 @@ fio_job=$testdir/fio_jobs/default_integrity.job tmp_attach_job=$testdir/fio_jobs/fio_attach.job.tmp tmp_detach_job=$testdir/fio_jobs/fio_detach.job.tmp -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" function print_test_fio_header() { notice "===============" @@ -201,7 +201,7 @@ function check_disks() { function get_traddr() { local nvme_name=$1 - local nvme="$( $SPDK_BUILD_DIR/scripts/gen_nvme.sh )" + local nvme="$( $rootdir/scripts/gen_nvme.sh )" while read -r line; do if [[ $line == *"TransportID"* ]] && [[ $line == *$nvme_name* ]]; then local word_array=($line) diff --git a/test/vhost/integrity/integrity_start.sh b/test/vhost/integrity/integrity_start.sh index 125cec0a4b..56f5a53d42 100755 --- a/test/vhost/integrity/integrity_start.sh +++ b/test/vhost/integrity/integrity_start.sh @@ -53,7 +53,7 @@ done vhosttestinit . $(readlink -e "$(dirname $0)/../common.sh") || exit 1 -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" trap 'error_exit "${FUNCNAME}" "${LINENO}"' SIGTERM SIGABRT ERR diff --git a/test/vhost/lvol/lvol_test.sh b/test/vhost/lvol/lvol_test.sh index 9b024af909..e99e3f8c9e 100755 --- a/test/vhost/lvol/lvol_test.sh +++ b/test/vhost/lvol/lvol_test.sh @@ -7,7 +7,7 @@ source $rootdir/test/common/autotest_common.sh source $rootdir/test/vhost/common.sh source $rootdir/scripts/common.sh -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" vm_count=1 max_disks="" diff --git a/test/vhost/migration/migration-tc1.sh b/test/vhost/migration/migration-tc1.sh index c6ae1d98b9..b864e831ae 100644 --- a/test/vhost/migration/migration-tc1.sh +++ b/test/vhost/migration/migration-tc1.sh @@ -21,7 +21,7 @@ function migration_tc1_configure_vhost() target_vm=1 incoming_vm_ctrlr=naa.Malloc0.$incoming_vm target_vm_ctrlr=naa.Malloc0.$target_vm - rpc="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" + rpc="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" trap 'migration_tc1_error_handler; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT diff --git a/test/vhost/migration/migration-tc2.sh b/test/vhost/migration/migration-tc2.sh index 2d2ecaebe7..419f63dab2 100644 --- a/test/vhost/migration/migration-tc2.sh +++ b/test/vhost/migration/migration-tc2.sh @@ -1,4 +1,4 @@ -source $SPDK_BUILD_DIR/test/nvmf/common.sh +source $rootdir/test/nvmf/common.sh function migration_tc2_cleanup_nvmf_tgt() { @@ -76,9 +76,9 @@ function migration_tc2_configure_vhost() incoming_vm_ctrlr=naa.VhostScsi0.$incoming_vm target_vm_ctrlr=naa.VhostScsi0.$target_vm - rpc_nvmf="$SPDK_BUILD_DIR/scripts/rpc.py -s $nvmf_dir/rpc.sock" - rpc_0="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" - rpc_1="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir 1)/rpc.sock" + rpc_nvmf="$rootdir/scripts/rpc.py -s $nvmf_dir/rpc.sock" + rpc_0="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" + rpc_1="$rootdir/scripts/rpc.py -s $(get_vhost_dir 1)/rpc.sock" # Default cleanup/error handlers will not shutdown nvmf_tgt app so setup it # here to teardown in cleanup function @@ -93,13 +93,13 @@ function migration_tc2_configure_vhost() notice "Running nvmf_tgt..." mkdir -p $nvmf_dir rm -f $nvmf_dir/* - $SPDK_BUILD_DIR/app/nvmf_tgt/nvmf_tgt -s 512 -m 0x4 -r $nvmf_dir/rpc.sock --wait-for-rpc & + $rootdir/app/nvmf_tgt/nvmf_tgt -s 512 -m 0x4 -r $nvmf_dir/rpc.sock --wait-for-rpc & local nvmf_tgt_pid=$! echo $nvmf_tgt_pid > $nvmf_dir/nvmf_tgt.pid waitforlisten "$nvmf_tgt_pid" "$nvmf_dir/rpc.sock" $rpc_nvmf start_subsystem_init $rpc_nvmf nvmf_create_transport -t RDMA -u 8192 - $SPDK_BUILD_DIR/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config + $rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config timing_exit start_nvmf_tgt spdk_vhost_run --memory=512 --vhost-num=0 --no-pci diff --git a/test/vhost/migration/migration-tc3a.sh b/test/vhost/migration/migration-tc3a.sh index 2bbf107e3a..d8b73f79a4 100644 --- a/test/vhost/migration/migration-tc3a.sh +++ b/test/vhost/migration/migration-tc3a.sh @@ -1,4 +1,4 @@ -source $SPDK_BUILD_DIR/test/nvmf/common.sh +source $rootdir/test/nvmf/common.sh source $MIGRATION_DIR/autotest.config incoming_vm=1 @@ -94,20 +94,20 @@ function host1_cleanup_vhost() function host1_start_nvmf() { nvmf_dir="$TEST_DIR/nvmf_tgt" - rpc_nvmf="$SPDK_BUILD_DIR/scripts/rpc.py -s $nvmf_dir/nvmf_rpc.sock" + rpc_nvmf="$rootdir/scripts/rpc.py -s $nvmf_dir/nvmf_rpc.sock" notice "Starting nvmf_tgt instance on local server" mkdir -p $nvmf_dir rm -rf $nvmf_dir/* trap 'host1_cleanup_nvmf SIGKILL; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT - $SPDK_BUILD_DIR/app/nvmf_tgt/nvmf_tgt -s 512 -m 0xF -r $nvmf_dir/nvmf_rpc.sock --wait-for-rpc & + $rootdir/app/nvmf_tgt/nvmf_tgt -s 512 -m 0xF -r $nvmf_dir/nvmf_rpc.sock --wait-for-rpc & nvmf_tgt_pid=$! echo $nvmf_tgt_pid > $nvmf_dir/nvmf_tgt.pid waitforlisten "$nvmf_tgt_pid" "$nvmf_dir/nvmf_rpc.sock" $rpc_nvmf start_subsystem_init $rpc_nvmf nvmf_create_transport -t RDMA -u 8192 - $SPDK_BUILD_DIR/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config + $rootdir/scripts/gen_nvme.sh --json | $rpc_nvmf load_subsystem_config $rpc_nvmf nvmf_subsystem_create nqn.2018-02.io.spdk:cnode1 -a -s SPDK01 $rpc_nvmf nvmf_subsystem_add_ns nqn.2018-02.io.spdk:cnode1 Nvme0n1 @@ -116,7 +116,7 @@ function host1_start_nvmf() function host1_start_vhost() { - rpc_0="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" + rpc_0="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock" notice "Starting vhost0 instance on local server" trap 'host1_cleanup_vhost; error_exit "${FUNCNAME}" "${LINENO}"' INT ERR EXIT @@ -154,7 +154,7 @@ function host_1_create_share() mkdir -p $VM_BASE_DIR # This dir would've been created later but we need it now rm -rf $share_dir/spdk.tar.gz $share_dir/spdk || true cp $os_image $share_dir/migration.qcow2 - tar --exclude="*.o"--exclude="*.d" --exclude="*.git" -C $SPDK_BUILD_DIR -zcf $share_dir/spdk.tar.gz . + tar --exclude="*.o"--exclude="*.d" --exclude="*.git" -C $rootdir -zcf $share_dir/spdk.tar.gz . } function host_2_create_share() diff --git a/test/vhost/migration/migration-tc3b.sh b/test/vhost/migration/migration-tc3b.sh index babba0dca9..71530cf3ac 100644 --- a/test/vhost/migration/migration-tc3b.sh +++ b/test/vhost/migration/migration-tc3b.sh @@ -7,7 +7,7 @@ source $MIGRATION_DIR/autotest.config incoming_vm=1 target_vm=2 target_vm_ctrl=naa.VhostScsi0.$target_vm -rpc="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir 1)/rpc.sock" +rpc="$rootdir/scripts/rpc.py -s $(get_vhost_dir 1)/rpc.sock" share_dir=$TEST_DIR/share function host_2_cleanup_vhost() diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index 41a8d0209f..e4e23c4387 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -36,7 +36,7 @@ vhosttestinit trap error_exit ERR -VHOST_APP="$SPDK_BUILD_DIR/app/vhost/vhost" +VHOST_APP="$rootdir/app/vhost/vhost" notice "Testing vhost command line arguments" # Printing help will force vhost to exit without error @@ -72,7 +72,7 @@ if [[ $RUN_NIGHTLY -eq 1 ]]; then spdk_vhost_run --json-path=$testdir notice "" - rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" + rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" # General commands notice "Trying to remove nonexistent controller" diff --git a/test/vhost/perf_bench/vhost_perf.sh b/test/vhost/perf_bench/vhost_perf.sh index ac74328890..892f2c4ff3 100755 --- a/test/vhost/perf_bench/vhost_perf.sh +++ b/test/vhost/perf_bench/vhost_perf.sh @@ -141,7 +141,7 @@ while getopts 'xh-:' optchar; do esac done -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" if [[ -n $custom_cpu_cfg ]]; then source $custom_cpu_cfg @@ -191,14 +191,14 @@ notice "Nvme split list: ${splits[@]}" if [[ $run_precondition == true ]]; then # Using the same precondition routine possible for lvols thanks # to --clear-method option. Lvols should not UNMAP on creation. - $SPDK_BUILD_DIR/scripts/gen_nvme.sh > $SPDK_BUILD_DIR/nvme.cfg - nvmes=$(cat $SPDK_BUILD_DIR/nvme.cfg | grep -oP "Nvme\d+") + $rootdir/scripts/gen_nvme.sh > $rootdir/nvme.cfg + nvmes=$(cat $rootdir/nvme.cfg | grep -oP "Nvme\d+") nvmes=($nvmes) fio_filename=$(printf ":%sn1" "${nvmes[@]}") fio_filename=${fio_filename:1} $precond_fio_bin --name="precondition" \ - --ioengine="${SPDK_BUILD_DIR}/examples/bdev/fio_plugin/fio_plugin" \ - --rw="write" --spdk_conf="${SPDK_BUILD_DIR}/nvme.cfg" --thread="1" \ + --ioengine="${rootdir}/examples/bdev/fio_plugin/fio_plugin" \ + --rw="write" --spdk_conf="${rootdir}/nvme.cfg" --thread="1" \ --group_reporting --direct="1" --size="100%" --loops="2" --bs="256k" \ --iodepth=32 --filename="${fio_filename}" || true fi diff --git a/test/vhost/shared/shared.sh b/test/vhost/shared/shared.sh index 10aa69c05f..cfec490e11 100755 --- a/test/vhost/shared/shared.sh +++ b/test/vhost/shared/shared.sh @@ -9,7 +9,7 @@ source $rootdir/test/vhost/common.sh PLUGIN_DIR=$rootdir/examples/bdev/fio_plugin FIO_PATH="/usr/src/fio" -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" function run_spdk_fio() { LD_PRELOAD=$PLUGIN_DIR/fio_plugin $FIO_PATH/fio --ioengine=spdk_bdev \ diff --git a/test/vhost/vhost_boot/vhost_boot.sh b/test/vhost/vhost_boot/vhost_boot.sh index 7068993cd5..76021b04f1 100755 --- a/test/vhost/vhost_boot/vhost_boot.sh +++ b/test/vhost/vhost_boot/vhost_boot.sh @@ -7,7 +7,7 @@ source $rootdir/test/common/autotest_common.sh source $rootdir/test/vhost/common.sh source $rootdir/test/bdev/nbd_common.sh -rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" +rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock" vm_no="0" function err_clean