Spdk/test/iscsi_tgt/rpc_config/rpc_config.sh
chenlo2x 62209642ce Autotest: revise coding-style of all script under the test/iscsi_tgt directory.
These changes were modified by the shfmt tool that supports Google's Style guide.

Change-Id: I27dd8ba91afc0043b3ce5f0eb6121a3c11789fab
Signed-off-by: chenlo2x <longx.o.chen@intel.com>
Reviewed-on: https://review.gerrithub.io/408147
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-08-01 16:42:19 +00:00

47 lines
954 B
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/test/common/autotest_common.sh
source $rootdir/test/iscsi_tgt/common.sh
timing_enter rpc_config
# $1 = test type (posix/vpp)
if [ "$1" == "posix" ] || [ "$1" == "vpp" ]; then
TEST_TYPE=$1
else
echo "No iSCSI test type specified"
exit 1
fi
MALLOC_BDEV_SIZE=64
rpc_py=$rootdir/scripts/rpc.py
rpc_config_py="python $testdir/rpc_config.py"
timing_enter start_iscsi_tgt
$ISCSI_APP -w &
pid=$!
echo "Process pid: $pid"
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $pid
$rpc_py set_iscsi_options -o 30 -a 16
$rpc_py start_subsystem_init
echo "iscsi_tgt is listening. Running tests..."
timing_exit start_iscsi_tgt
$rpc_config_py $rpc_py $TARGET_IP $INITIATOR_IP $ISCSI_PORT $NETMASK $TARGET_NAMESPACE $TEST_TYPE
$rpc_py get_bdevs
trap - SIGINT SIGTERM EXIT
iscsicleanup
killprocess $pid
timing_exit rpc_config