diff --git a/test/common/applications.sh b/test/common/applications.sh new file mode 100644 index 000000000..a038c5d95 --- /dev/null +++ b/test/common/applications.sh @@ -0,0 +1,11 @@ +# Default set of apps used in functional testing + +_root=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") +_root=${_root%/test/common} +_app_dir=$_root/app +_test_app_dir=$_root/test/app + +FUZZ_APP=("$_test_app_dir/fuzz/vhost_fuzz/vhost_fuzz") +ISCSI_APP=("$_app_dir/iscsi_tgt/iscsi_tgt") +NVMF_APP=("$_app_dir/nvmf_tgt/nvmf_tgt") +VHOST_APP=("$_app_dir/vhost/vhost") diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 12f3d1e9c..8cd0f8790 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -16,6 +16,8 @@ xtrace_disable set -e shopt -s expand_aliases +source "$rootdir/test/common/applications.sh" + # Dummy function to be called after restoring xtrace just so that it appears in the # xtrace log. This way we can consistently track when xtrace is enabled/disabled. function xtrace_enable() { diff --git a/test/fuzz/autofuzz_nvmf.sh b/test/fuzz/autofuzz_nvmf.sh index 501651640..a8ca0c3f4 100755 --- a/test/fuzz/autofuzz_nvmf.sh +++ b/test/fuzz/autofuzz_nvmf.sh @@ -24,7 +24,7 @@ timing_enter nvmf_fuzz_test echo "[Nvme]" > $testdir/nvmf_fuzz.conf echo " TransportID \"trtype:$TEST_TRANSPORT adrfam:IPv4 subnqn:nqn.2016-06.io.spdk:cnode1 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT\" Nvme0" >> $testdir/nvmf_fuzz.conf -$NVMF_APP -m 0xF &>$output_dir/nvmf_autofuzz_tgt_output.txt & +"${NVMF_APP[@]}" -m 0xF &>"$output_dir/nvmf_autofuzz_tgt_output.txt" & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; rm -f $testdir/nvmf_fuzz.conf; killprocess $nvmfpid; nvmftestfini $1; exit 1' SIGINT SIGTERM EXIT diff --git a/test/fuzz/autofuzz_vhost.sh b/test/fuzz/autofuzz_vhost.sh index 963004116..36f6d02a3 100755 --- a/test/fuzz/autofuzz_vhost.sh +++ b/test/fuzz/autofuzz_vhost.sh @@ -6,9 +6,9 @@ source "$rootdir/scripts/common.sh" TEST_TIMEOUT=1200 -VHOST_APP="$rootdir/app/vhost/vhost -p 0" +VHOST_APP+=(-p 0) FUZZ_RPC_SOCK="/var/tmp/spdk_fuzz.sock" -FUZZ_APP="$rootdir/test/app/fuzz/vhost_fuzz/vhost_fuzz -r $FUZZ_RPC_SOCK --wait-for-rpc" +FUZZ_APP+=(-r "$FUZZ_RPC_SOCK" --wait-for-rpc) vhost_rpc_py="$rootdir/scripts/rpc.py" fuzz_generic_rpc_py="$rootdir/scripts/rpc.py -s $FUZZ_RPC_SOCK" @@ -29,13 +29,13 @@ timing_enter setup $rootdir/scripts/setup.sh timing_exit setup -$VHOST_APP &>$output_dir/vhost_fuzz_tgt_output.txt & +"${VHOST_APP[@]}" &>"$output_dir/vhost_fuzz_tgt_output.txt" & vhostpid=$! waitforlisten $vhostpid trap 'killprocess $vhostpid; exit 1' SIGINT SIGTERM exit -$FUZZ_APP -t $TEST_TIMEOUT 2>$output_dir/vhost_autofuzz_output1.txt & +"${FUZZ_APP[@]}" -t $TEST_TIMEOUT 2>"$output_dir/vhost_autofuzz_output1.txt" & fuzzpid=$! waitforlisten $fuzzpid $FUZZ_RPC_SOCK diff --git a/test/iscsi_tgt/bdev_io_wait/bdev_io_wait.sh b/test/iscsi_tgt/bdev_io_wait/bdev_io_wait.sh index b754b8099..44197f073 100755 --- a/test/iscsi_tgt/bdev_io_wait/bdev_io_wait.sh +++ b/test/iscsi_tgt/bdev_io_wait/bdev_io_wait.sh @@ -14,7 +14,7 @@ rpc_py="$rootdir/scripts/rpc.py" timing_enter start_iscsi_tgt -$ISCSI_APP -m 0x2 -p 1 -s 512 --wait-for-rpc & +"${ISCSI_APP[@]}" -m 0x2 -p 1 -s 512 --wait-for-rpc & pid=$! echo "iSCSI target launched. pid: $pid" trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/calsoft/calsoft.sh b/test/iscsi_tgt/calsoft/calsoft.sh index a80bb3cb4..b2fe56703 100755 --- a/test/iscsi_tgt/calsoft/calsoft.sh +++ b/test/iscsi_tgt/calsoft/calsoft.sh @@ -28,7 +28,7 @@ echo "IP=$TARGET_IP" >> /usr/local/etc/its.conf timing_enter start_iscsi_tgt -$ISCSI_APP -m 0x1 --wait-for-rpc & +"${ISCSI_APP[@]}" -m 0x1 --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/common.sh b/test/iscsi_tgt/common.sh index 36b7d1bdd..ac7de0309 100644 --- a/test/iscsi_tgt/common.sh +++ b/test/iscsi_tgt/common.sh @@ -2,7 +2,7 @@ TARGET_INTERFACE="spdk_tgt_int" INITIATOR_INTERFACE="spdk_init_int" TARGET_NAMESPACE="spdk_iscsi_ns" -TARGET_NS_CMD="ip netns exec $TARGET_NAMESPACE" +TARGET_NS_CMD=(ip netns exec "$TARGET_NAMESPACE") # iSCSI target configuration TARGET_IP=10.0.0.1 @@ -12,9 +12,9 @@ NETMASK=$INITIATOR_IP/32 INITIATOR_TAG=2 INITIATOR_NAME=ANY PORTAL_TAG=1 -ISCSI_APP="$TARGET_NS_CMD ./app/iscsi_tgt/iscsi_tgt" +ISCSI_APP=("${TARGET_NS_CMD[@]}" "${ISCSI_APP[@]}") if [ $SPDK_TEST_VPP -eq 1 ]; then - ISCSI_APP+=" -L sock_vpp" + ISCSI_APP+=(-L sock_vpp) fi ISCSI_TEST_CORE_MASK=0xFF @@ -37,11 +37,11 @@ function create_veth_interfaces() { # Accept connections from veth interface iptables -I INPUT 1 -i $INITIATOR_INTERFACE -p tcp --dport $ISCSI_PORT -j ACCEPT - $TARGET_NS_CMD ip link set $TARGET_INTERFACE up + "${TARGET_NS_CMD[@]}" ip link set $TARGET_INTERFACE up if [ "$1" == "posix" ]; then - $TARGET_NS_CMD ip link set lo up - $TARGET_NS_CMD ip addr add $TARGET_IP/24 dev $TARGET_INTERFACE + "${TARGET_NS_CMD[@]}" ip link set lo up + "${TARGET_NS_CMD[@]}" ip addr add $TARGET_IP/24 dev $TARGET_INTERFACE # Verify connectivity ping -c 1 $TARGET_IP @@ -112,7 +112,7 @@ function start_vpp() { ethtool -k $INITIATOR_INTERFACE # Start VPP process in SPDK target network namespace - $TARGET_NS_CMD vpp \ + "${TARGET_NS_CMD[@]}" vpp \ unix { nodaemon cli-listen /run/vpp/cli.sock } \ dpdk { no-pci } \ session { evt_qs_memfd_seg } \ diff --git a/test/iscsi_tgt/digests/digests.sh b/test/iscsi_tgt/digests/digests.sh index b14277ee8..3a03c10ec 100755 --- a/test/iscsi_tgt/digests/digests.sh +++ b/test/iscsi_tgt/digests/digests.sh @@ -53,7 +53,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt -$ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & +"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/ext4test/ext4test.sh b/test/iscsi_tgt/ext4test/ext4test.sh index 7a7a9f111..de58f2a96 100755 --- a/test/iscsi_tgt/ext4test/ext4test.sh +++ b/test/iscsi_tgt/ext4test/ext4test.sh @@ -14,7 +14,7 @@ node_base="iqn.2013-06.com.intel.ch.spdk" timing_enter start_iscsi_tgt -$ISCSI_APP --wait-for-rpc & +"${ISCSI_APP[@]}" --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/filesystem/filesystem.sh b/test/iscsi_tgt/filesystem/filesystem.sh index 78aa79f74..73173009a 100755 --- a/test/iscsi_tgt/filesystem/filesystem.sh +++ b/test/iscsi_tgt/filesystem/filesystem.sh @@ -27,7 +27,7 @@ function remove_backends() { timing_enter start_iscsi_tgt -$ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & +"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/fio/fio.sh b/test/iscsi_tgt/fio/fio.sh index eaa3c6165..0a3f3df5a 100755 --- a/test/iscsi_tgt/fio/fio.sh +++ b/test/iscsi_tgt/fio/fio.sh @@ -28,7 +28,7 @@ function running_config() { timing_enter start_iscsi_tgt2 - $ISCSI_APP --wait-for-rpc & + "${ISCSI_APP[@]}" --wait-for-rpc & pid=$! echo "Process pid: $pid" trap 'iscsicleanup; killprocess $pid; delete_tmp_files; exit 1' SIGINT SIGTERM EXIT @@ -62,7 +62,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt -$ISCSI_APP --wait-for-rpc & +"${ISCSI_APP[@]}" --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/initiator/initiator.sh b/test/iscsi_tgt/initiator/initiator.sh index 82e1a2398..64f76fe4c 100755 --- a/test/iscsi_tgt/initiator/initiator.sh +++ b/test/iscsi_tgt/initiator/initiator.sh @@ -16,7 +16,7 @@ rpc_py="$rootdir/scripts/rpc.py" timing_enter start_iscsi_tgt -$ISCSI_APP -m 0x2 -p 1 -s 512 --wait-for-rpc & +"${ISCSI_APP[@]}" -m 0x2 -p 1 -s 512 --wait-for-rpc & pid=$! echo "iSCSI target launched. pid: $pid" trap 'killprocess $pid;exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/ip_migration/ip_migration.sh b/test/iscsi_tgt/ip_migration/ip_migration.sh index c8006670b..a1f361fa2 100755 --- a/test/iscsi_tgt/ip_migration/ip_migration.sh +++ b/test/iscsi_tgt/ip_migration/ip_migration.sh @@ -14,7 +14,8 @@ fio_py="$rootdir/scripts/fio.py" # Namespaces are NOT used here on purpose. This test requires changes to detect # ifc_index for interface that was put into namespace. Needed for net_interface_add_ip_address. -ISCSI_APP="$rootdir/app/iscsi_tgt/iscsi_tgt" +# Reset ISCSI_APP[] to use only the plain app for this test without TARGET_NS_CMD preset. +source "$rootdir/test/common/applications.sh" NETMASK=127.0.0.0/24 MIGRATION_ADDRESS=127.0.0.2 @@ -82,7 +83,7 @@ for ((i = 0; i < 2; i++)); do rpc_addr="/var/tmp/spdk${i}.sock" # TODO: run the different iSCSI instances on non-overlapping CPU masks - $ISCSI_APP -r $rpc_addr -i $i -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & + "${ISCSI_APP[@]}" -r $rpc_addr -i $i -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/lvol/iscsi_lvol.sh b/test/iscsi_tgt/lvol/iscsi_lvol.sh index 86f53cecb..095149900 100755 --- a/test/iscsi_tgt/lvol/iscsi_lvol.sh +++ b/test/iscsi_tgt/lvol/iscsi_lvol.sh @@ -24,7 +24,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt -$ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & +"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/multiconnection/multiconnection.sh b/test/iscsi_tgt/multiconnection/multiconnection.sh index fe5eaa6dc..badf70197 100755 --- a/test/iscsi_tgt/multiconnection/multiconnection.sh +++ b/test/iscsi_tgt/multiconnection/multiconnection.sh @@ -35,7 +35,7 @@ function remove_backends() { } timing_enter start_iscsi_tgt -$ISCSI_APP --wait-for-rpc & +"${ISCSI_APP[@]}" --wait-for-rpc & iscsipid=$! echo "iSCSI target launched. pid: $iscsipid" trap 'remove_backends; iscsicleanup; killprocess $iscsipid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh b/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh index fa48fadf0..38329dc43 100755 --- a/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh +++ b/test/iscsi_tgt/nvme_remote/fio_remote_nvme.sh @@ -23,8 +23,7 @@ function run_nvme_remote() { echo "now use $1 method to run iscsi tgt." iscsi_rpc_addr="/var/tmp/spdk-iscsi.sock" - ISCSI_APP="$rootdir/app/iscsi_tgt/iscsi_tgt" - $ISCSI_APP -r "$iscsi_rpc_addr" -m 0x1 -p 0 -s 512 --wait-for-rpc & + "${ISCSI_APP[@]}" -r "$iscsi_rpc_addr" -m 0x1 -p 0 -s 512 --wait-for-rpc & iscsipid=$! echo "iSCSI target launched. pid: $iscsipid" trap 'killprocess $iscsipid; iscsitestfini $1 $2; nvmftestfini; exit 1' SIGINT SIGTERM EXIT @@ -54,8 +53,7 @@ function run_nvme_remote() { } # Start the NVMf target -NVMF_APP="$rootdir/app/nvmf_tgt/nvmf_tgt" -$NVMF_APP -m 0x2 -p 1 -s 512 --wait-for-rpc & +"${NVMF_APP[@]}" -m 0x2 -p 1 -s 512 --wait-for-rpc & nvmfpid=$! echo "NVMf target launched. pid: $nvmfpid" trap 'iscsitestfini $1 $2; nvmftestfini; exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/pmem/iscsi_pmem.sh b/test/iscsi_tgt/pmem/iscsi_pmem.sh index 1f0378284..da6fd77f4 100755 --- a/test/iscsi_tgt/pmem/iscsi_pmem.sh +++ b/test/iscsi_tgt/pmem/iscsi_pmem.sh @@ -16,7 +16,7 @@ rpc_py="$rootdir/scripts/rpc.py" fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_target -$ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & +"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/qos/qos.sh b/test/iscsi_tgt/qos/qos.sh index e10c7b3bc..0e013b790 100755 --- a/test/iscsi_tgt/qos/qos.sh +++ b/test/iscsi_tgt/qos/qos.sh @@ -59,7 +59,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt -$ISCSI_APP & +"${ISCSI_APP[@]}" & pid=$! echo "Process pid: $pid" trap 'killprocess $pid; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/rbd/rbd.sh b/test/iscsi_tgt/rbd/rbd.sh index 73f6dec5b..6c498ff0e 100755 --- a/test/iscsi_tgt/rbd/rbd.sh +++ b/test/iscsi_tgt/rbd/rbd.sh @@ -24,7 +24,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt -$ISCSI_APP -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & +"${ISCSI_APP[@]}" -m $ISCSI_TEST_CORE_MASK --wait-for-rpc & pid=$! trap 'killprocess $pid; rbd_cleanup; iscsitestfini $1 $2; exit 1' SIGINT SIGTERM EXIT diff --git a/test/iscsi_tgt/reset/reset.sh b/test/iscsi_tgt/reset/reset.sh index 16fb8884f..406a10c45 100755 --- a/test/iscsi_tgt/reset/reset.sh +++ b/test/iscsi_tgt/reset/reset.sh @@ -21,7 +21,7 @@ fi timing_enter start_iscsi_tgt -$ISCSI_APP --wait-for-rpc & +"${ISCSI_APP[@]}" --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/rpc_config/rpc_config.sh b/test/iscsi_tgt/rpc_config/rpc_config.sh index ab608c331..ce54b4ab2 100755 --- a/test/iscsi_tgt/rpc_config/rpc_config.sh +++ b/test/iscsi_tgt/rpc_config/rpc_config.sh @@ -23,7 +23,7 @@ rpc_config_py="$testdir/rpc_config.py" timing_enter start_iscsi_tgt -$ISCSI_APP --wait-for-rpc & +"${ISCSI_APP[@]}" --wait-for-rpc & pid=$! echo "Process pid: $pid" diff --git a/test/iscsi_tgt/sock/sock.sh b/test/iscsi_tgt/sock/sock.sh index fef6488e8..99879197b 100755 --- a/test/iscsi_tgt/sock/sock.sh +++ b/test/iscsi_tgt/sock/sock.sh @@ -81,7 +81,7 @@ if [ "$TEST_TYPE" != "posix" ] && [ "$TEST_TYPE" != "vpp" ]; then exit 1 fi -HELLO_SOCK_APP="$TARGET_NS_CMD $rootdir/examples/sock/hello_world/hello_sock" +HELLO_SOCK_APP="${TARGET_NS_CMD[*]} $rootdir/examples/sock/hello_world/hello_sock" if [ $SPDK_TEST_VPP -eq 1 ]; then HELLO_SOCK_APP+=" -L sock_vpp" fi diff --git a/test/iscsi_tgt/trace_record/trace_record.sh b/test/iscsi_tgt/trace_record/trace_record.sh index 0f390f864..e13f80893 100755 --- a/test/iscsi_tgt/trace_record/trace_record.sh +++ b/test/iscsi_tgt/trace_record/trace_record.sh @@ -38,7 +38,7 @@ fio_py="$rootdir/scripts/fio.py" timing_enter start_iscsi_tgt echo "start iscsi_tgt with trace enabled" -$ISCSI_APP -m 0xf --num-trace-entries $NUM_TRACE_ENTRIES --tpoint-group-mask 0xf & +"${ISCSI_APP[@]}" -m 0xf --num-trace-entries $NUM_TRACE_ENTRIES --tpoint-group-mask 0xf & iscsi_pid=$! echo "Process pid: $iscsi_pid" diff --git a/test/nvmf/common.sh b/test/nvmf/common.sh index 20b7f51ad..6f4376a6f 100644 --- a/test/nvmf/common.sh +++ b/test/nvmf/common.sh @@ -8,14 +8,15 @@ NVMF_SERIAL=SPDK00000000000001 function build_nvmf_app_args() { if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then - echo "sudo -u $(logname) ./app/nvmf_tgt/nvmf_tgt -i $NVMF_APP_SHM_ID -e 0xFFFF" + NVMF_APP=(sudo -u "$USER" "${NVMF_APP[@]}") + NVMF_APP+=(-i "$NVMF_APP_SHM_ID" -e 0xFFFF) else - echo "./app/nvmf_tgt/nvmf_tgt -i $NVMF_APP_SHM_ID -e 0xFFFF" + NVMF_APP+=(-i "$NVMF_APP_SHM_ID" -e 0xFFFF) fi } : ${NVMF_APP_SHM_ID="0"}; export NVMF_APP_SHM_ID -: ${NVMF_APP="$(build_nvmf_app_args)"}; export NVMF_APP +build_nvmf_app_args have_pci_nics=0 @@ -207,7 +208,7 @@ function nvmftestinit() function nvmfappstart() { timing_enter start_nvmf_tgt - $NVMF_APP $1 & + "${NVMF_APP[@]}" $1 & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT waitforlisten $nvmfpid diff --git a/test/nvmf/host/fio.sh b/test/nvmf/host/fio.sh index 3c46992f4..8121382df 100755 --- a/test/nvmf/host/fio.sh +++ b/test/nvmf/host/fio.sh @@ -17,7 +17,7 @@ fi timing_enter start_nvmf_tgt -$NVMF_APP -m 0xF & +"${NVMF_APP[@]}" -m 0xF & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT diff --git a/test/nvmf/host/identify.sh b/test/nvmf/host/identify.sh index b12bda5b6..cc503d127 100755 --- a/test/nvmf/host/identify.sh +++ b/test/nvmf/host/identify.sh @@ -14,7 +14,7 @@ nvmftestinit timing_enter start_nvmf_tgt -$NVMF_APP -m 0xF & +"${NVMF_APP[@]}" -m 0xF & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT diff --git a/test/nvmf/target/fuzz.sh b/test/nvmf/target/fuzz.sh index ee9fff9fc..538cb1d70 100755 --- a/test/nvmf/target/fuzz.sh +++ b/test/nvmf/target/fuzz.sh @@ -9,7 +9,7 @@ rpc_py="$rootdir/scripts/rpc.py" nvmftestinit -$NVMF_APP -m 0xF >$output_dir/nvmf_fuzz_tgt_output.txt 2>&1 & +"${NVMF_APP[@]}" -m 0xF >$output_dir/nvmf_fuzz_tgt_output.txt 2>&1 & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; rm -f $testdir/nvmf_fuzz.conf; killprocess $nvmfpid; nvmftestfini $1; exit 1' SIGINT SIGTERM EXIT diff --git a/test/nvmf/target/identify_passthru.sh b/test/nvmf/target/identify_passthru.sh index afc707f7a..e102c749c 100755 --- a/test/nvmf/target/identify_passthru.sh +++ b/test/nvmf/target/identify_passthru.sh @@ -26,7 +26,7 @@ timing_exit nvme_identify timing_enter start_nvmf_tgt -$NVMF_APP -m 0xF --wait-for-rpc & +"${NVMF_APP[@]}" -m 0xF --wait-for-rpc & nvmfpid=$! trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EXIT diff --git a/test/nvmf/target/nvmf_vhost.sh b/test/nvmf/target/nvmf_vhost.sh index 700bb69ae..6fd53db8c 100755 --- a/test/nvmf/target/nvmf_vhost.sh +++ b/test/nvmf/target/nvmf_vhost.sh @@ -18,13 +18,13 @@ NVMF_SOCK="/tmp/nvmf_rpc.sock" NVMF_RPC="$rootdir/scripts/rpc.py -s $NVMF_SOCK" VHOST_SOCK="/tmp/vhost_rpc.sock" -VHOST_APP="$rootdir/app/vhost/vhost -p 0 -r $VHOST_SOCK -u" +VHOST_APP+=(-p 0 -r "$VHOST_SOCK" -u) VHOST_RPC="$rootdir/scripts/rpc.py -s $VHOST_SOCK" nvmftestinit # Start Apps -$NVMF_APP -r $NVMF_SOCK & +"${NVMF_APP[@]}" -r $NVMF_SOCK & nvmfpid=$! waitforlisten $nvmfpid $NVMF_SOCK @@ -32,7 +32,7 @@ trap 'process_shm --id $NVMF_APP_SHM_ID; nvmftestfini; exit 1' SIGINT SIGTERM EX mkdir -p "$(get_vhost_dir 3)" -$VHOST_APP -S "$(get_vhost_dir 3)" & +"${VHOST_APP[@]}" -S "$(get_vhost_dir 3)" & vhostpid=$! waitforlisten $vhostpid $NVMF_SOCK diff --git a/test/vhost/fuzz/fuzz.sh b/test/vhost/fuzz/fuzz.sh index 865a9dcf7..5a17c5fc9 100755 --- a/test/vhost/fuzz/fuzz.sh +++ b/test/vhost/fuzz/fuzz.sh @@ -5,21 +5,21 @@ rootdir=$(readlink -f $(dirname $0))/../../.. source $rootdir/test/common/autotest_common.sh source "$rootdir/scripts/common.sh" -VHOST_APP="$rootdir/app/vhost/vhost -p 0" +VHOST_APP+=(-p 0) FUZZ_RPC_SOCK="/var/tmp/spdk_fuzz.sock" -FUZZ_APP="$rootdir/test/app/fuzz/vhost_fuzz/vhost_fuzz -r $FUZZ_RPC_SOCK --wait-for-rpc" +FUZZ_APP+=(-r "$FUZZ_RPC_SOCK" --wait-for-rpc) vhost_rpc_py="$rootdir/scripts/rpc.py" fuzz_generic_rpc_py="$rootdir/scripts/rpc.py -s $FUZZ_RPC_SOCK" fuzz_specific_rpc_py="$rootdir/test/app/fuzz/common/fuzz_rpc.py -s $FUZZ_RPC_SOCK" -$VHOST_APP >$output_dir/vhost_fuzz_tgt_output.txt 2>&1 & +"${VHOST_APP[@]}" >"$output_dir/vhost_fuzz_tgt_output.txt" 2>&1 & vhostpid=$! waitforlisten $vhostpid trap 'killprocess $vhostpid; exit 1' SIGINT SIGTERM exit -$FUZZ_APP -t 10 2>$output_dir/vhost_fuzz_output1.txt & +"${FUZZ_APP[@]}" -t 10 2>"$output_dir/vhost_fuzz_output1.txt" & fuzzpid=$! waitforlisten $fuzzpid $FUZZ_RPC_SOCK @@ -47,7 +47,7 @@ $fuzz_generic_rpc_py framework_start_init wait $fuzzpid -$FUZZ_APP -j $rootdir/test/app/fuzz/vhost_fuzz/example.json 2>$output_dir/vhost_fuzz_output2.txt & +"${FUZZ_APP[@]}" -j "$rootdir/test/app/fuzz/vhost_fuzz/example.json" 2>"$output_dir/vhost_fuzz_output2.txt" & fuzzpid=$! waitforlisten $fuzzpid $FUZZ_RPC_SOCK diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index 6566b07d7..829dceeca 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -36,30 +36,28 @@ vhosttestinit trap error_exit ERR -VHOST_APP="$rootdir/app/vhost/vhost" - notice "Testing vhost command line arguments" # Printing help will force vhost to exit without error -$VHOST_APP -c /path/to/non_existing_file/conf -S $testdir -e 0x0 -s 1024 -d -h --silence-noticelog +"${VHOST_APP[@]}" -c /path/to/non_existing_file/conf -S $testdir -e 0x0 -s 1024 -d -h --silence-noticelog # Testing vhost create pid file option. Vhost will exit with error as invalid config path is given -if $VHOST_APP -c /path/to/non_existing_file/conf -f $VHOST_DIR/vhost/vhost.pid; then +if "${VHOST_APP[@]}" -c /path/to/non_existing_file/conf -f "$VHOST_DIR/vhost/vhost.pid"; then fail "vhost started when specifying invalid config file" fi rm -f $VHOST_DIR/vhost/vhost.pid # Testing vhost start with invalid config. Vhost will exit with error as bdev module init failed -if $VHOST_APP -c $testdir/invalid.config; then +if "${VHOST_APP[@]}" -c $testdir/invalid.config; then fail "vhost started when specifying invalid config file" fi # Expecting vhost to fail if an incorrect argument is given -if $VHOST_APP -x -h; then +if "${VHOST_APP[@]}" -x -h; then fail "vhost started with invalid -x command line option" fi # Passing trace flags if spdk is build without CONFIG_DEBUG=y option make vhost exit with error -if ! $VHOST_APP -t vhost_scsi -h; then +if ! "${VHOST_APP[@]}" -t vhost_scsi -h; then warning "vhost did not started with trace flags enabled but ignoring this as it might not be a debug build" fi