Commit b4c5509c authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/common: Source *_APP from a common place



Instead of declaring each app in the actual test, source their default
declarations from a single location. Additionally, use them as arrays
now instead for easier cmdline management.

Change-Id: I0ea39403f070dc57987065ebb800e91c35de643a
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/690


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 6f7cb2ad
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
# 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")
+2 −0
Original line number Diff line number Diff line
@@ -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() {
+1 −1
Original line number Diff line number Diff line
@@ -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
+4 −4
Original line number Diff line number Diff line
@@ -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

+1 −1
Original line number Diff line number Diff line
@@ -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
Loading