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/../../..)
|
2016-08-03 21:37:16 +00:00
|
|
|
source $rootdir/scripts/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
|
|
|
|
|
|
|
|
# iSCSI target configuration
|
|
|
|
PORT=3260
|
|
|
|
INITIATOR_TAG=2
|
2017-11-29 05:51:23 +00:00
|
|
|
INITIATOR_NAME=ANY
|
2016-08-03 21:37:16 +00:00
|
|
|
NETMASK=$INITIATOR_IP/32
|
2016-10-17 08:30:26 +00:00
|
|
|
MALLOC_BDEV_SIZE=64
|
2016-08-03 21:37:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
|
|
|
rpc_config_py="python $testdir/rpc_config.py"
|
|
|
|
|
2017-05-25 20:06:51 +00:00
|
|
|
timing_enter start_iscsi_tgt
|
2016-08-03 21:37:16 +00:00
|
|
|
|
2017-05-24 23:29:24 +00:00
|
|
|
$ISCSI_APP -c $testdir/iscsi.conf &
|
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
|
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
|
|
|
|
|
2016-08-03 21:37:16 +00:00
|
|
|
$rpc_config_py $rpc_py
|
|
|
|
|
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
|