2016-08-03 21:37:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
2017-04-04 23:20:16 +00:00
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2018-02-27 22:14:08 +00:00
|
|
|
source $rootdir/test/common/autotest_common.sh
|
2017-05-24 23:29:24 +00:00
|
|
|
source $rootdir/test/iscsi_tgt/common.sh
|
2016-08-03 21:37:16 +00:00
|
|
|
|
|
|
|
timing_enter rpc_config
|
|
|
|
|
2018-04-23 07:04:15 +00:00
|
|
|
# $1 = test type (posix/vpp)
|
|
|
|
if [ "$1" == "posix" ] || [ "$1" == "vpp" ]; then
|
2018-04-18 08:36:46 +00:00
|
|
|
TEST_TYPE=$1
|
2018-04-23 07:04:15 +00:00
|
|
|
else
|
2018-04-18 08:36:46 +00:00
|
|
|
echo "No iSCSI test type specified"
|
|
|
|
exit 1
|
2018-04-23 07:04:15 +00:00
|
|
|
fi
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2018-04-23 07:04:15 +00:00
|
|
|
MALLOC_BDEV_SIZE=64
|
2016-08-03 21:37:16 +00:00
|
|
|
|
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
2018-09-11 13:26:14 +00:00
|
|
|
rpc_config_py="$testdir/rpc_config.py"
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-05-25 20:06:51 +00:00
|
|
|
timing_enter start_iscsi_tgt
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2018-08-10 10:20:25 +00:00
|
|
|
$ISCSI_APP --wait-for-rpc &
|
2016-08-03 21:37:16 +00:00
|
|
|
pid=$!
|
|
|
|
echo "Process pid: $pid"
|
|
|
|
|
2017-01-27 22:10:58 +00:00
|
|
|
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-11-09 23:33:29 +00:00
|
|
|
waitforlisten $pid
|
2018-07-12 19:26:27 +00:00
|
|
|
$rpc_py set_iscsi_options -o 30 -a 16
|
|
|
|
$rpc_py start_subsystem_init
|
2016-08-03 21:37:16 +00:00
|
|
|
echo "iscsi_tgt is listening. Running tests..."
|
|
|
|
|
2017-05-25 20:06:51 +00:00
|
|
|
timing_exit start_iscsi_tgt
|
|
|
|
|
2018-04-23 07:04:15 +00:00
|
|
|
$rpc_config_py $rpc_py $TARGET_IP $INITIATOR_IP $ISCSI_PORT $NETMASK $TARGET_NAMESPACE $TEST_TYPE
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2016-11-18 17:22:58 +00:00
|
|
|
$rpc_py get_bdevs
|
|
|
|
|
2016-08-03 21:37:16 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
iscsicleanup
|
|
|
|
killprocess $pid
|
|
|
|
timing_exit rpc_config
|