2016-08-03 21:37:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$testdir/../../..
|
|
|
|
source $rootdir/scripts/autotest_common.sh
|
|
|
|
|
|
|
|
if [ -z "$TARGET_IP" ]; then
|
|
|
|
echo "TARGET_IP not defined in environment"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INITIATOR_IP" ]; then
|
|
|
|
echo "INITIATOR_IP not defined in environment"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
timing_enter rpc_config
|
|
|
|
|
|
|
|
# iSCSI target configuration
|
|
|
|
PORT=3260
|
|
|
|
RPC_PORT=5260
|
|
|
|
INITIATOR_TAG=2
|
|
|
|
INITIATOR_NAME=ALL
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
|
|
./app/iscsi_tgt/iscsi_tgt -c $testdir/iscsi.conf &
|
|
|
|
pid=$!
|
|
|
|
echo "Process pid: $pid"
|
|
|
|
|
|
|
|
trap "process_core; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
waitforlisten $pid ${RPC_PORT}
|
|
|
|
echo "iscsi_tgt is listening. Running tests..."
|
|
|
|
|
|
|
|
$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
|